简体   繁体   English

如何将外部SQL Server数据库添加到ASP.NET MVC应用程序(C#)

[英]How to add external SQL Server database to an ASP.NET MVC application (c#)

I want to add external SQL Server database to my ASP.NET MVC application (C#). 我想将外部SQL Server数据库添加到我的ASP.NET MVC应用程序(C#)。 For the project for which I am working, I have to use external SQL Server database instead of using built-in local database. 对于我正在处理的项目,我必须使用外部SQL Server数据库而不是内置的本地数据库。

Can anyone help me? 谁能帮我? Thanks in advance. 提前致谢。

在您的项目/解决方案中,添加一个ADO.Net实体模型。

Either add Entity Framework to your solution or look up how to work with System.Data.SqlClient.SqlCommand. 将Entity Framework添加到您的解决方案中,或者查找如何使用System.Data.SqlClient.SqlCommand。 You'll likely end up using both as both have it's advantages. 由于两者都有其优势,您可能最终会同时使用两者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM