System. The Data. SqlClient. SqlException: "users' his171201210 'login failed,"
CodePudding user response:
SQL server hybrid testSet a sa password
The connection string in the user name sa, password set the password for you
CodePudding user response:
The problem of the database Settings?Connect to the database code 1, suggest you to switch to the orm
CodePudding user response:
His171201210 user name rather than the database name is: are you sure?CodePudding user response:
This is the codeThe class DB
{
Private static readonly string connstring="server=DESKTOP - 38 ck79r; The database=his171201210; User=his; The PWD=123456 ";
Public static SqlConnection conn=new SqlConnection (connstring);
Public static void opendatabase ()
{
Try
{
Conn. The Open ();
}
The catch (Exception ex)
{
MessageBox. Show (ex. Message. The ToString ());
}
}
}
CodePudding user response:
On the first floor said method has already get theI put my user name changed to ihs is still wrong, his171201210 is the database name,
CodePudding user response:
I get to get out again to the new problems, the database connection is not on, going awayCodePudding user response:
Could it be that doesn't suit the SQL server serviceCodePudding user response:
With local visualization tools to see can even on firstCodePudding user response:
See if the database configuration tool, agent didn't openCodePudding user response:
As a first step, using the database management tools you need to be able to log in, and you can keep track of your account and password, and you connect to the database instance name is usually the sa account, and install the database when you set the database sa password, original database instance can be used. Try,Second, check your connection string, can go to baidu one,
CodePudding user response:
Authentication is essentially and Windows?Is to use mixed authentication mode
CodePudding user response:
First of all determine whether the address and account password okSecondly confirm the server service is normal