Close SqlServer Database
-
Hi I want to close sqlserver opened database from my project. SqlConnection just close the connection, not the database. more info :
sqlConnection1.Open(server=computer;database=xdb); . . . sqlconnection1.Close(); . . . RestoreDatabase(xdb); //error:database is in use
:doh: Tanx. -
Hi I want to close sqlserver opened database from my project. SqlConnection just close the connection, not the database. more info :
sqlConnection1.Open(server=computer;database=xdb); . . . sqlconnection1.Close(); . . . RestoreDatabase(xdb); //error:database is in use
:doh: Tanx.If you are using a datareader you may have to close this as well i.e datareader.Close(); HTH Darren
-
Hi I want to close sqlserver opened database from my project. SqlConnection just close the connection, not the database. more info :
sqlConnection1.Open(server=computer;database=xdb); . . . sqlconnection1.Close(); . . . RestoreDatabase(xdb); //error:database is in use
:doh: Tanx.You will probably find that the connection is still present because it is pooled.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world." Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that." Deja View - the feeling that you've seen this post before.