我装SQL时,没有选择用户sa,用的是WindowsNT
<add key="connectionString" value="server=.;database=BookStore;uid=sa;pwd=sa"/>
这是我一个.net程序的Web.config文件里面的,请问我应该怎么改这个语句?我执行程序就有这个错误,不知道是不是数据库问题,希望高手指点一下!谢谢!Server Application Error
The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance.
有两种方案:
1.改掉你的SQLServer的登陆方式,将WINDOWS集成登陆改成用户名密码的这种。
这样你的这个连接基本不用改。
2.改掉你的连接语句。SQLServer可以不动
连接字符串 "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=你的数据库名;Data Source=SQL Server所在的计算机名
SA登录:
连接字符串 "Provider=SQLOLEDB.1;Password=用户密码;Persist Security Info=True;User ID=用户名(sa);Initial Catalog=你的数据库名;Data Source=SQL Server所在的计算机名