【发布时间】:2013-08-30 17:16:15
【问题描述】:
我试图简单地将我的本地 sql server 数据库用于测试应用程序,但我尝试过的连接字符串都没有工作。
我可以通过这样做来证明本地访问:
C:\Users\myusername>sqlcmd -S MYNAME-MBP-W7\SQLEXPRESS
1> Go
1> select name from sys.databases
2> Go
name
------------------
master
tempdb
model
msdb
(4 rows affected)
1>
然后,我尝试在我的 VS 项目中,在 web.config 文件中使用受信任的连接身份验证设置到这个本地运行的数据库服务器的本地连接,就像受信任的连接下的命令 found here 这个页面显示了一些东西喜欢:
Data Source=myServerAddress;
Initial Catalog=myDataBase;
Integrated Security=SSPI;
User ID=myDomain\myUsername;Password=myPassword;
我试过了,但出现“找不到服务器”错误
<add name="GuitarContext"
providerName="System.Data.SqlClient"
connectionString="Data Source=(localhost);
Initial Catalog=aspnet-GuitarCollector-20130830123055;
Integrated Security=SSPI;
user id =PDC1\myusername; password=mypassword" />
感谢您提供故障排除和/或解决此问题的任何帮助。
【问题讨论】:
标签: asp.net-mvc-3 entity-framework-4