2
Reply

How to check whether database or table exist?

try abc

try abc

Dec 20 2007 8:05 AM
13.5k
    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)