Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (SqlCeConnection conn = new SqlCeConnection(validateConnStr))
- {
- using (SqlCeCommand cmd = new SqlCeCommand(@"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES", conn))
- {
- try
- {
- conn.Open();
- SqlCeDataReader rdr = cmd.ExecuteReader();
- string[] tableArr = { "FirstTable", "SecondTable" };
- int ta = 0;
- while (rdr.Read())
- {
- if (rdr.GetString(0) != tableArr[ta])
- {
- isValidDbFile = false;
- }
- else
- {
- isValidDbFile = true;
- }
- ta++;
- }
- }
- catch (Exception ex)
- {
- //MessageBox.Show(ex.ToString());
- }
- finally
- {
- conn.Close();
- }
- }
- }
Add Comment
Please, Sign In to add comment