We have unit tests to verify that our database installation and removal functions work successfully. Unit tests use the SqlClient.SqlConnection class to check the contents of a database before, during, and after.
Our problem is that after using SqlClient.SqlConnection, the deleted drop login part is deleted due to the fact that it claims that the user is currently logged in. Although we called SqlConnection.Close () the login seems to be still open.
Our code looks something like this:
InstallTables();
string connString = CreateLogin("userName", "password");
using (SqlConnection con = new SqlConnection(connString))
{
con.Open();
}
DropTables();
DropLogin("userName", "password");
DropLogin :
System.Data.SqlClient.SqlException: login_class_unittest_129418264074692569, .
SqlConnection , DropLogin, .
- , , SqlConnection.Close()?
- ?