开发者

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

I have an exis开发者_高级运维ting database in SQL Server. I am trying to create an asp.net mvc project around this db.

For this purpose I need to add the db to app_data folder of asp.net MVC project

How do I achieve this?

Note:

The SQL Server is in another system and I do not have rights to install SQL Server Express on my machine as well :(


You don't need to add app_data directory or install SQL Express on your machine. All you need is a connection string allowing you to connect to the remote database.

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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜