通过登录页面asp.net失败的SQL Server用户 [英] Login failed for SQL Server user through asp.net page

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

问题描述

我想通过一个asp.net页面连接到SQL服务器和我收到此错误:
无法打开数据库DBNAME的登录请求。登录失败。
用户登录失败'用户名'。
当我尝试在SQL中使用相同的凭据直接登录它连接成功。而在webconfig的用户名和密码设置是否正确。

I am trying to connect to SQL server through an asp.net page and I am getting this error: Cannot open database "dbname" requested by the login. The login failed. Login failed for user 'username'. And when I try to login directly at SQL using the same credentials it does connect successfully. And the username and password set in the webconfig are correct.

我试着设置新的密码,从数据库中删除用户并重新添加它,但它不会通过网络只能通过SQL工作。

I tried setting a new password, remove the user from the database and add it again but it doesn't work through web only through SQL.

推荐答案

数据库(或初始目录)在连接字符串中值是指一个数据库(在服务器上)不退出或登录不具有的权限。

The Database (or Initial Catalog) value in the connection string refers to a database (on the server) that doesn't exits or the login has no permissions.

当您连接使用SQL工具,它拿起默认数据库(由登录定义)或正在发送一个工作值

When you connect using the SQL tools, it is picking up the default database (defined by the login) or you are sending a working value

编辑,评论后

错误称的无法打开数据库DBNAME由登录请求。

这意味着产生在asp.net值连接字符串是错误的数据库。歧义这里不多范围

This means the database value in the asp.net generated connection string is wrong. Not much scope for ambiguity here

这篇关于通过登录页面asp.net失败的SQL Server用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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