how can i know the connection status in c#?
Posted by: mexp
Date: January 17, 2007 02:13AM

here is my code:

conn = new MySql.Data.MySqlClient.MySqlConnection();
conn.ConnectionString = "server=127.0.0.1;uid=root;pwd=mypwd;";
cmd = new MySql.Data.MySqlClient.MySqlCommand();
cmd.Connection = conn;
conn.open()

after conn.open(), I shutdown the mysql server.
but the 'conn.State' neither ConnectionState.Broken nor ConnectionState.Closed.
and I get exception when I execute sql command.



Edited 2 time(s). Last edit at 01/17/2007 04:37AM by mexp .

Options: ReplyQuote


Subject
Written By
Posted
how can i know the connection status in c#?
January 17, 2007 02:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.