/// <summary>
/// 初次使用创建数据库
/// </summary>
public static void CreateDataBase()
{
try
{
bool isExist = File.Exists(DataPath);
if (!isExist)
{
SQLiteConnection.CreateFile(DataPath);
}
conn = new SQLiteConnection(ConnStr);
conn.Open();
comm = conn.CreateCommand();
if (!isExist)
{
String sql = "Create table ReceiveData(DeviceNum INTEGER , Temperature INTEGER , Humidity INTEGER , Tyrere INTEGER , MotorState INTEGER , ErrorNum INTEGER , CreateDate DateTime);";
comm.CommandText = sql;
comm.CommandType = CommandType.Text;
comm.ExecuteNonQuery();
}
}
catch (Exception e)
{
}
}