try abc

try abc

  • 1.4k
  • 306
  • 488.1k

How to check whether database or table exist?

Dec 20 2007 8:05 AM
    Hello,,
                I want to to check whether the Database is already exist in to the Specified Database server.. and also for table.. Is anybody knows the query for this?? i alreasy use the following query . but as the ExecuteNonQuery() only return the rows affeted by the Insert, Update and Delete query. Plz Help

query = "show tables from db_micro_structure;
com = new MySqlCommand(query, myConnection);
try
            {
                myConnection.Open();
                              
               MessageBox.Show(com.ExecuteNonQuery().ToString());
                myConnection.Close();
              
               
            }
            catch
            {
             
            }

Answers (2)