Пример #1
0
        public void Drop()
        {
            Debug.Assert(Table != null);

            object te;
            string sql = string.Format("drop table {0}", Table.DBTableName);

            using (SQLiteDataProvider sqlData = new SQLiteDataProvider())
            {
                string testExistSql = string.Format("SELECT COUNT(*) FROM sqlite_master where type='table' and name='{0}'", Table.DBTableName);
                sqlData.Connect(Table.ConnectionString);
                try
                {
                    te = sqlData.ExecuteScalar(testExistSql);

                    if (te != DBNull.Value)
                    {
                        if (long.Parse(te.ToString()) > 0)
                        {
                            sqlData.ExecuteNonQuery(sql);
                        }
                    }
                }
                catch
                {
                }
            }
        }