//判断数据库中的表是否存在 cmd.Connection = conn; cmd.CommandText = "SELECT COUNT(*) FROM sqlite_master where type='table' and name='DBInfo'"; if (Convert.ToInt32(cmd.ExecuteScalar()) == 0) CreatTB();