sql server数据库未通过sql server身份验证连接 [英] sql server database not connecting through sql server authentication

查看:131
本文介绍了sql server数据库未通过sql server身份验证连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个应用程序,并将其发布在IIS上.但是当我运行该应用程序时,它没有与数据库连接.
我正在使用sql服务器身份验证模式通过数据库进行连接.它也没有显示错误.您能否指导我如何通过sql server身份验证模式连接数据库.
当我通过本地主机运行该应用程序时,该应用程序已成功运行,但在服务器上发布该应用程序后未成功运行.这将有助于获取确切的错误.

 尝试
{
  //  dbconnection方法
  //  SqlConnection connection =新的SqlConnection(connectionString); 

}
捕获(例外)
{
  //  
} 


您好,请检查以下几点

1.首先检查Sql Server,打开SQLServer并使用SQL身份验证登录,输入userid和pwd.

2.如果第一"正确,则在应用程序中检查您的连接字符串,连接字符串中是否包含所有参数,例如服务器,数据库,用户标识,密码等.

3.如果first不正确,则首先使用Windows身份验证登录并更改sql中的设置,更改为SQL Server身份验证并分配用户ID和密码并保存此设置.

4.现在,再次使用该uid和pwd登录.

希望它将解决您的问题. :-)


I have created an application an published it on IIS. but when I am running that application it is not being connected with the database.
I am using sql server authentication mode to connect through database. It is not showing error also. Can you please guide me how connect database through sql server authentication mode.
And that application is running successfully when i am running through local host but not after publishing it on server

解决方案

Write try.. catch block around DBConnection method. It will help to get the exact error.

try
{
  // dbconnection method
  // SqlConnection connection = new SqlConnection(connectionString);

}
catch (Exception ex)
{
  //
}


Hi, check below point

1. First check Sql Server,open SQLServer and login on this using SQL Authentication, giving userid and pwd.

2. If First is correct then check your connection string in application, there are all parameters in connection string i.e. Server, Database, userid, password etc.

3. If first is incorrect then first login with windows authentication and change settings in sql, change to SQL Server Authentication and assign userid and password and save this setting.

4. now again login with using that uid and pwd.

Hopefully, it will solve your problem. :-)


这篇关于sql server数据库未通过sql server身份验证连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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