开发者

can't connect to sql database from visual studio

开发者 https://www.devze.com 2023-04-11 19:39 出处:网络
I am working on asp.net website with sql database which provides membership support. After the membership module and the database were created I attached the database to my local sql server.

I am working on asp.net website with sql database which provides membership support. After the membership module and the database were created I attached the database to my local sql server. I am having mixed mode for authentication in the sql server, and I am authenticated with my sql server login credentials at this moment. Now, when I am trying to establish connection from my asp.net solution I am getting this error:

Cannot open user default database. Login failed. Login fai开发者_如何学Goled for user 'username'.

Any advice? Thanks in advance, Laziale


You have an incorrect connection string for the database in question. A good resource, for setting up connection strings, is connectionstrings.com. The best way to fix this is log directly into SQL Server and make sure you have a user/password combo that works. Once you do that, you can use that combo in the connection string.

Since this is local, you should not have other problems, but one possibility to look into, esp. with SQL logins, is making sure the TCP protocol is enabled in SQL Server for connection. The "login failed" error message indicates this IS NOT your current problem, however.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号