public bool CreateTableStructure() { //try //{ // //List<String> lstTableName = (List<String>)_databaseService.GetDataListBySQL<string>(new StringBuilder(DBSchemaDefinition.GetTableNameBySpecificValueSQL("DeviceInfo8021"))); // if (lstTableName.Count == 0)//数据库中不存在表DeviceInfo8007 // { // StringBuilder sbDeviceInfoSQL = new StringBuilder("Create table DeviceInfo8021("); // sbDeviceInfoSQL.Append("ID integer not null primary key autoincrement,"); // sbDeviceInfoSQL.Append("Code varchar(8),"); // sbDeviceInfoSQL.Append("Disable Boolean,"); // sbDeviceInfoSQL.Append("CurrentThreshold real,"); // sbDeviceInfoSQL.Append("TemperatureThreshold real,"); // sbDeviceInfoSQL.Append("BuildingNo integer,"); // sbDeviceInfoSQL.Append("ZoneNo integer,"); // sbDeviceInfoSQL.Append("FloorNo integer,"); // sbDeviceInfoSQL.Append("RoomNo integer,"); // sbDeviceInfoSQL.Append("Location varchar(20),"); // sbDeviceInfoSQL.Append("LoopID integer references Loop(ID) on delete restrict deferrable initially deferred not null,"); // sbDeviceInfoSQL.Append("TypeCode integer references DeviceType(Code) on delete restrict deferrable initially deferred not null,unique(Code,LoopID));"); // _databaseService.ExecuteBySql(sbDeviceInfoSQL); // } //} //catch //{ // return false; //} //return true; try { List <String> lstTableName = _dbFileVersionService.GetTablesOfDB("DeviceInfo8021"); if (lstTableName.Count == 0)//数据库中不存在表DeviceInfo8021 { _dbFileVersionService.CreateTableForDeviceInfoOfControllerType8021(); } } catch { return(false); } return(true); }