无法打开数据库"测试"登录所请求。登录失败。用户登录失败'某某\\ ASPNET' [英] Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'

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

问题描述

我创建了一些数据保存到数据库到一个web服务。但我得到这个错误

I have created a webservice which is saving some data into to db. But i am getting this error

无法打开数据库测试要求
  通过登录。登录失败。登录
  失败,用户XYZ \\ ASPNET'。

Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'.

我的连接字符串结果

添加NAME =ConnectionString1的connectionString =数据源= \\ SQLEx preSS;初始目录= IFItest;集成安全性=真的providerName =System.Data.SqlClient的

推荐答案

那么,错误的是pretty清楚,不是吗?您正在试图连接到用户使用XYZ / ASPNET您的SQL Server - 这是你的ASP.NET应用程序下运行的帐户

Well, the error is pretty clear, no? You are trying to connect to your SQL Server with user "xyz/ASPNET" - that's the account your ASP.NET app is running under.

此账户是不允许连接到SQL Server - 无论是SQL Server上创建一个登录该帐户,或者那么你的连接字符串中指定其他有效的SQL Server的帐户

This account is not allowed to connect to SQL Server - either create a login on SQL Server for that account, or then specify another valid SQL Server account in your connection string.

您能告诉我们您的连接字符串(通过更新原来的问题)?

Can you show us your connection string (by updating your original question)?

更新:好吧,你使用集成的Windows身份验证 - >您需要在SQL Server上创建某某\\ ASPNETSQL Server登录 - 或者改变你的连接字符串,类似

UPDATE: ok, you're using integrated Windows authentication --> you need to create a SQL Server login for "xyz\ASPNET" on your SQL Server - or change your connection string to something like

connectionString="Servere=.\SQLExpress;Database=IFItest;User ID=xyz;pwd=top$secret"

如果你有一个用户XYZ与顶$秘密在数据库中的密码。

if you have a user "xyz" with a password of "top$secret" in your database.

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

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