无法打开登录名请求的数据库CSE-DEPT.用户登录失败, [英] cannot open database CSE-DEPT requested by the login. the login failed for the user,,,

查看:84
本文介绍了无法打开登录名请求的数据库CSE-DEPT.用户登录失败,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.当我尝试通过vc#applicaton连接到数据库"CSE-DEPT"时收到此错误.我的连接字符串是:

Hi. I receive this error when I try to connect to the database ''CSE-DEPT'' through my vc# applicaton. My connection string is:

SqlConnection conn = new SqlConnection(@"server = .\sqlexpress; integrated security = true ;database = CSE_DEPT");


我尝试了
的解决方案


I tried the solution of

"Go to SQL Server >> Security >> Logins and right click on NT AUTHORITY\NETWORK SERVICE and select Properties. In newly opened screen of Login Properties, go to the "User Mapping" tab. Then, on the "User Mapping" tab, select the desired database – especially the database for which this error message is displayed. On the lower screen, check the role db_owner. Click OK."



但是没有用.
对此初学者来说,您的详细回答是值得赞赏的.



but it didnt work.
Your detailed answer is appreciated for this beginner

推荐答案

语录:

"转到SQL Server>>安全性>>登录名,然后右键单击 NT AUTHORITY \ NETWORK SERVICE ,然后选择属性".在新打开的登录属性"屏幕中,转到用户映射"选项卡.在用户映射"选项卡上,选择所需的数据库,尤其是显示此错误消息的数据库.在下部屏幕上,检查角色db_owner.单击确定".

"Go to SQL Server >> Security >> Logins and right click on NT AUTHORITY\NETWORK SERVICE and select Properties. In newly opened screen of Login Properties, go to the "User Mapping" tab. Then, on the "User Mapping" tab, select the desired database – especially the database for which this error message is displayed. On the lower screen, check the role db_owner. Click OK.




不用网络服务来执行此操作,而是使用您自己的帐户名重复该服务.




Instead of doing this with the Network Service, repeat the service with your own account name.


http://i.imgur.com/cMQe1.png

基于此,用户"REZA-CS \ REZA"的登录失败

为用户提供的凭据不正确.提供带有用户名和密码的完整连接字符串.试试看.
http://i.imgur.com/cMQe1.png

Bases on this, login failed for user "REZA-CS\REZA"

Credentials provided for the user were incorrect. Give complete connection string with username and password. Try out and see.


这篇关于无法打开登录名请求的数据库CSE-DEPT.用户登录失败,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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