using System.Data.SQLite;//若没有库需要在Nugut下载
private void ReadDatabase()
{
//判断有无数据库
if (!File.Exists(dbPath))
{
SQLiteConnection.CreateFile(dbPath);
MessageBox.Show("数据库重新创建成功");
}
//判断有无表
if (sqliteConn.State == ConnectionState.Closed) sqliteConn.Open();
SQLiteCommand mDbCmd = sqliteConn.CreateCommand();
mDbCmd.CommandText = "SELECT COUNT(*) FROM sqlite_master where type='table' and name='" + TableDbFile + "';";

最低0.47元/天 解锁文章
1421





