Hello, Need help with this piece of code .... Whether the table exists or not I still have Message 2 coming. How do I know if a table exists? thank you,
Program.Connex_Bdd.Open(); var query_ttle = "SELECT count(*) FROM sqlite_master WHERE type='table' AND name='My_Tble' COLLATE NOCASE"; var cmd = new SQLiteCommand(query_ttle, Program.Connex_Bdd); int i = 0; i = int.Parse(cmd.ExecuteScalar().ToString()); if (i > 0) { MessageBox.Show("1"); } else { MessageBox.Show("2"); } Program.Connex_Bdd.Close();
ExecuteScalar
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)