Re: Stupid Question about Tables
You'd be better off using Connector/NET 5.
Here's one way:
public Int32 TableExists( string db, string table, MySqlConnection conn ) {
object obj = null;
MySqlCommand cmd = new MySqlCommand();
try {
cmd.CommandText = "SELECT COUNT(*) FROM information_schema.tables " +
"WHERE table_schema = '" + db + "' "
"AND table_name = '" + table + "'";
cmd.Connection = conn;
obj = cmd.ExecuteScalar();
}
catch ( MySqlException ex ) {
MessageBox.Show( ex.Message + Environment.NewLine + ex.StackTrace.ToString(); );
}
finally {
cmd.Dispose();
}
return Int32.Parse( obj.ToString() );
}
PB
Subject
Written By
Posted
November 24, 2006 07:49AM
Re: Stupid Question about Tables
November 24, 2006 10:05AM
November 24, 2006 10:51AM
November 27, 2006 09:07AM
November 27, 2006 11:35AM
November 28, 2006 02:26PM
November 28, 2006 10:34PM
November 29, 2006 08:44AM
November 29, 2006 10:34AM
November 30, 2006 09:30AM
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.