我试图连接到数据库:
string ConnectionString = "SERVER=localhost;"
+ "DATABASE=testdb;"
+ "User Id=wsuser;"
+ "PASSWORD=12345;"
+ "Integrated Security=True;";
SqlConnection Connection = new SqlConnection(ConnectionString);
Connection.Open();并得到了误差System.Data.SqlClient.SqlException: "Cannot open database "testdb" requested by the login. The login failed. Login failed for user 'DESKTOP-F9N7UKE\Stolz'."
在mysql中,我有用户wsuser和testdb数据库的所有工具。有人知道怎么解决这个异常吗?
发布于 2018-06-17 09:54:48
Mysql数据库连接如下所示
string ConnectionString = "SERVER=localhost;"
+ "DATABASE=testdb;"
+ "User Id=wsuser;"
+ "PASSWORD=12345;"
MySqlConnection Connection = new
MySqlConnection(ConnectionString);
Connection.Open();使用MySqlconnection连接Mysql数据库,使用Sqlconnection连接Sqlserver。
https://stackoverflow.com/questions/50895404
复制相似问题