用户'sa'登录失败 [英] Login failed for user 'sa'

查看:67
本文介绍了用户'sa'登录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个连接到sql server数据库的asp.net web应用程序。它工作正常,直到我删除数据库并使用sql脚本重新创建它。之后我开始收到以下错误:



用户sa登录失败。



我的连接字符串是:



Hi,

I have an asp.net web application connected to a sql server database. It was working fine until I deleted the database and recreate it by using sql script. after that I started to get the following error:

Login failed for user ''sa''.

My connection string is:

<add name="AuditConnectionString" connectionstring="Data Source=.;Initial Catalog=myDB;Integrated Security=false; User ID=sa; Password=mypass" />





即使我尝试使用以下连接:





Even when I tried to use the following connection:

<add name="AuditConnectionString" connectionstring="Data Source=.;Initial Catalog=myDB;Integrated Security=true;" />





我得到了同样的错误:



无法打开登录请求的数据库myDB。登录失败。



谁能告诉我出了什么问题?



谢谢你,
Missa



I got the same error:

Cannot open database "myDB" requested by the login. The login failed.

Can anyone tell me what is wrong?

Thank you,
Missa

推荐答案

你使用sql 2008 express吗?
are you useing sql 2008 express?


最好的办法是在页面上添加一个SqlDataSource临时配置它如下面的msdn文章(按照4到9步骤获得准确的连接字符串)并复制该连接string..test连接,如果它成功然后在您的配置设置中超过它然后删除SqlDataSource

http://msdn.microsoft.com/en-us/library/ms247242 (v = vs.100).aspx [ ^ ]
Best idea is add one SqlDataSource temporary on page configure it as in following msdn article(follow 4 to 9 step to get accurate connection string) and copy that connection string..test connection if it succeed then past it in your config setting and then delete SqlDataSource
http://msdn.microsoft.com/en-us/library/ms247242(v=vs.100).aspx[^]


这篇关于用户'sa'登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆