Hello,
First the context: In my C# application form, I use an SqlConnection to access a Microsoft SQL Server located on a remote server:
I want to manage errors when my network cable is unplugged. So I thought that treating the exception raised by the SqlConnection.O pen() method would do it.
Now, my problem is the exception which should be raised when I unplugg my cable is not always.
Especially, it seems that when I process successfully a command, then unplug my cable, the next connection I'll try to open won't raised any exception.
That's a bit annoying... no network cable, and the Open() method does not raise any exception... -_-
Any ideas?
First the context: In my C# application form, I use an SqlConnection to access a Microsoft SQL Server located on a remote server:
Code:
connection = new SqlConnection(strConnection);
try {
connection.Open();
} catch {
return;
}
Now, my problem is the exception which should be raised when I unplugg my cable is not always.
Especially, it seems that when I process successfully a command, then unplug my cable, the next connection I'll try to open won't raised any exception.
That's a bit annoying... no network cable, and the Open() method does not raise any exception... -_-
Any ideas?
Comment