ASP.NET Access Control Edition MVC Bootstrap

0

Good morning!

I have a project created and it already contains an access control system that was created automatically when I created the project, I would like to know if it would be possible to edit this access control or if it would be better to create a new one, I would like to send the data for a table in my bank, he is currently using this connection:

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-Administracao-20151103112933.mdf;Initial Catalog=aspnet-Administracao-20151103112933;Integrated Security=True" providerName="System.Data.SqlClient" />

What should I do to save these records to my DB? (below my connection to my DB)

    <add name="naescola" connectionString="Data Source=(localdb)\ProjectsV12;Initial Catalog=NaEscola;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;Min Pool Size=50" />
    
asked by anonymous 10.12.2015 / 14:20

2 answers

1

Just change the DefaultConnection to point to your bank, it will create all tables (all from scratch).

 <add name="DefaultConnection" connectionString="Data Source=IP;Initial Catalog=NOBD;Persist Security Info=True;User Id=USUARIO;Password=SENHA;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />

This is one of mine that I did exactly what you want, for SQLServer     

10.12.2015 / 14:31
1

You need to create a link between your project and database, the Entity Framework is responsible for this, for those who are starting the Wizard / p>

In the Model of your project, right-click the Add option and New Item option. On the screen that will appear choose the Data option in the browser, which is on the left side, and in the square on the right choose the ADO.NET Entity Data Model option. In the example below the project name is ControlAcess.cs.

Youcanfollowtherestofthewalkthrough HERE .

References: Devmidia.

    
10.12.2015 / 14:36