将C#MVC应用程序连接到远程SQL Server数据库 [英] Connect a C# MVC application to a remote SQL Server database
本文介绍了将C#MVC应用程序连接到远程SQL Server数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个位于http://192.168.10.3/MyDB
的SQL Server数据库.我已经创建了一个C#MVC应用程序,并且我需要知道将我的应用程序连接到上述数据库的步骤.
I have a SQL Server database located at http://192.168.10.3/MyDB
. I have created a C# MVC application, and I need to know the steps to connect my application to the above database.
是否仅替换web.config
文件中的连接字符串?
Is it only replacing the connection string in the web.config
file ?
Data Source=?? ;Initial Catalog=??;Integrated Security=SSPI;
User ID=??;Password=pwd;
如果是的话,我要替换放置??
标志的位置是什么?
If so what am I to replace where I have placed the ??
sign ?
推荐答案
- DataSource = 192.168.10.3
- 初始目录= MyDB
- 用户ID =您用于访问SQL Server的任何SQL登录名
- 密码=上面的sql登录密码
这篇关于将C#MVC应用程序连接到远程SQL Server数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文