服务器上的连接字符串问题 [英] Connection String issue on Server

查看:87
本文介绍了服务器上的连接字符串问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用SQL在asp.net中创建了一个Web应用程序.我在web.config中提到了ConnectionString,如下所示:

Hi,
I have created a web application in asp.net with SQL.I have mentioned ConnectionString in web.config as follows:

<connectionStrings>
  <add name="xyzConnectionString" connectionString="Data Source=.\SQLEXPRESS; Initial Catalog=XYZ;Integrated Security=True;Trusted_Connection=No" providerName="System.Data.SqlClient"/>
  </connectionStrings>


但是,当我在Parallels Plesk Panel Dedicated服务器上上传此Web应用程序并与数据库连接时,出现如下错误::

"/"应用程序中的服务器错误.
用户"的登录失败.
说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的详细信息.
异常详细信息:System.Data.SqlClient.SqlException:用户"的登录失败.


请帮帮我.
预先感谢.


But when i am uploading this webapplication on Parallels Plesk Panel Dedicated server and connect with database then i am getting an error as follows::

Server Error in ''/'' Application.
Login failed for user ''''.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user ''''.


Please help me.
Thanks in advance.

推荐答案


如下更改连接字符串
Hi,
Change your connection string as below
Data Source=.\SQLEXPRESS; Initial Catalog=XYZ;User ID=personal; Integrated Security=SSPI;Persist Security Info=False;


您可能会发现这些资源很有用
http://geekswithblogs.net/ranganh/archive/2005/05/25/40489.aspx [^ ]


you may find these resources useful
http://blogs.msdn.com/b/sql_protocols/archive/2008/05/03/understanding-the-error-message-login-failed-for-user-the-user-is-not-associated-with-a-trusted-sql-server-connection.aspx[^]
http://geekswithblogs.net/ranganh/archive/2005/05/25/40489.aspx[^]


Trusted_Connection=No

更改为

Trusted_Connection=Yes


放置Trusted_Connection =在连接字符串中为是.
Put Trusted_Connection=Yes in connection string.


这篇关于服务器上的连接字符串问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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