无法打开登录请求的数据库“databasename”。登录失败。用户登录失败 [英] Cannot open database “databasename” requested by the login. The login failed. Login failed for user

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

问题描述

这就是场景。我正在用VB.NET(Windows Forms)创建桌面应用程序,并使用SQL Server 2008 r2作为其数据库。我有两台计算机(PC1和PC2),我想连接PC2到PC1。 PC 1具有microsoft sql server数据库。我做的是我只是将.exe应用程序复制到我的vb项目的调试文件夹中并为其连接创建一个记事本并将它们放入一个文件夹并将其传输到PC2。



当我将我的appplication运行到其他PC时,我收到错误



您的应用程序中发生了未处理的异常。如果单击继续,应用程序将忽略此错误并尝试继续,如果单击退出,应用程序将立即关闭。



无法打开数据库DatabaseName请求通过登录。登录失败。用户登录失败




我在记事本中的代码



This is the scenario.I'm creating a desktop application with VB.NET (Windows Forms), and using SQL Server 2008 r2 for its database.I have two computers(PC1 and PC2) and I want to connect PC2 to PC1 . PC 1 has the microsoft sql server database. What i do is i just copied .exe application in the debug folder of my vb project and create a notepad for its connection and put them into one folder and transfer it to PC2.

When i run my appplication to other PC, I got an error of

Unhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue, If you click quit, The application will close immediately.

Cannot open database "DatabaseName" requested by the login. The Login failed. Login failed for user


My code inside the notepad

Data Source=PC1;Initial Catalog=DBSAS;Integrated Security=True





有人可以给我一个关于此的建议。我真的很困惑。谢谢



我尝试过:



我做了什么远程是启用SQL Server 2008的远程连接。



Can someone please give me an advice about this. I am really confuse. Thanks

What I have tried:

What i have done so far is to enable remote connection of SQL server 2008.

推荐答案

hi



它是sims你正在使用用于连接数据库的Windows身份验证

尝试使用sql身份验证我觉得远程连接更方便
hi

It sims you are using Windows authentication to connect to the database
try using sql authentication i find it more convenient for remote connectivity


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

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