How to add an existing SQL Server database to the asp.net MVC project app_data folder

I have an existing database in SQL Server. I am trying to create an asp.net mvc project around this db.

To do this, I need to add db to the app_data folder of the asp.net MVC project

How do I achieve this?

Note:

SQL Server is on a different system, and I do not have permission to install SQL Server Express on my computer :(

+4
source share
1 answer

You do not need to add the app_data directory or install SQL Express on your computer. All you need is a connection string that allows you to connect to a remote database.

 Data Source=NameOfDbServer;Database=DatabaseName;User ID=User;Password=PWD;Trusted_Connection=False 

Once you have the connection string, you can start the database query. How you do this will depend on the technology you would like to use: NHibernate , LINQ to SQL , LINQ To Entities , plain old ADO.NET , ...

+4
source

Source: https://habr.com/ru/post/1304758/


All Articles