public bool Delete(string DetectorName, string CounterType, ElementList sParams) { DataRow dr = null; string table = "CountingParams"; if (CounterType.Equals("Multiplicity") || CounterType.Equals("Coincidence")) table = "LMMultiplicity"; Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return false; } if (table.Equals("LMMultiplicity")) dr = HasRow(l, CounterType, table, sParams, sParams[faidx].Value); // the FA parameter else dr = HasRow(l, CounterType, table, sParams); if (dr != null) { string sSQL = "DELETE FROM " + table + " where counter_type=" + SQLSpecific.QVal(CounterType) + " AND detector_id=" + l.ToString(); if (table.Equals("LMMultiplicity")) sSQL += " AND " + sParams[faidx].Name + "=" + sParams[faidx].Value; return db.Execute(sSQL); } else return true; }
private DataTable BasicSelect(string DetectorName, string CounterType, string table, string FA) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); return(GetTable(l, CounterType, table, FA)); }
// delete all the stratum associations with a detector public bool Unassociate(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "DELETE FROM stratum_id_detector where " + "(stratum_id_detector.detector_id=" + l.ToString() + ")"; return(db.Execute(sSQL)); }
public DataTable Get(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * FROM " + table + " where detector_id = " + l.ToString(); DataTable dt = db.DT(sSQL); return dt; }
public bool Associate(string measDetId, string stratumID) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); long m = PrimaryKey(stratumID); string saSQL = "insert into stratum_id_detector VALUES(" + l.ToString() + "," + m.ToString() + ")"; return(db.Execute(saSQL)); }
public DataTable Get(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * FROM " + table + " where detector_id = " + l.ToString(); DataTable dt = db.DT(sSQL); return(dt); }
private void GetKeys(string DetectorName, string ItemType, out long l, out long m) { db.SetConnection(); Detectors dets = new Detectors(db); l = dets.PrimaryKey(DetectorName); Descriptors mats = new Descriptors("material_types", db); m = mats.PrimaryKey(ItemType); }
public bool Create(string measDetId, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); sParams.Add(new Element("detector_id", l)); string sSQL1 = "Insert into " + table + " "; string sSQL = sSQL1 + sParams.ColumnsValues; return db.Execute(sSQL); }
public DataTable Get(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * from LMNetComm, LMHWParams where (LMNetComm.detector_id=" + l.ToString() + " AND LMHWParams.detector_id=" + l.ToString() + ")"; DataTable dt = db.DT(sSQL); return(dt); }
public DataTable Get(DateTimeOffset measDatetime, string measDetId, string item_type) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * FROM LMAcquireParams where detector_id = " + l.ToString() + " AND item_type=" + SQLSpecific.Value(item_type, true); DataTable dt = db.DT(sSQL); return(dt); }
public bool Update(string measDetId, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL1 = "UPDATE " + table + " SET "; string sSQL1i = String.Empty; string wh = " where " + "detector_id = " + l.ToString(); string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; return db.Execute(sSQL); }
public bool Has(string DetectorName, string CounterType) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); string sSQL = "Select * from INNER JOIN LMMultiplicity, CountingParams ON (LMMultiplicity.detector_id=CountingParams.detector_id) " + "where detector_id=" + l.ToString() + " AND " + "counter_type=" + SQLSpecific.QVal(CounterType); DataTable dt = db.DT(sSQL); return(dt.Rows.Count > 0); }
// joins the matching LM if found public DataTable Get(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "select * from acquire_parms_rec left join LMAcquireParams on (LMAcquireParams.detector_id=" + l.ToString() + ") " + "where (acquire_parms_rec.meas_detector_id=" + SQLSpecific.Value(measDetId, true) + ")" + " order by acquire_parms_rec.MeasDate DESC"; DataTable dt = db.DT(sSQL); return dt; }
public bool Update(string measDetId, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL1 = "UPDATE " + table + " SET "; string sSQL1i = String.Empty; string wh = " where " + "detector_id = " + l.ToString(); string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; return(db.Execute(sSQL)); }
public bool Update(string measDetId, string item_type, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL1 = "UPDATE LMAcquireParams SET "; string sSQL1i = String.Empty; string wh = " where " + "item_type = " + SQLSpecific.Value(item_type, true) + " AND detector_id = " + l.ToString(); string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; return(db.Execute(sSQL)); }
public bool Create(DateTimeOffset measDatetime, string measDetId, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); sParams.Add(new Element("detector_id", l)); string sSQL1 = "Insert into LMAcquireParams "; string sSQL = sSQL1 + sParams.ColumnsValues; return(db.Execute(sSQL)); }
public bool Delete(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL1 = "DELETE from " + table; string sSQL1i = String.Empty; string wh = " where " + "detector_id = " + l.ToString(); string sSQL = sSQL1 + wh; return(db.Execute(sSQL)); }
public DataTable Get(string measDetId) // joins the matching LM if found { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "select * from acquire_parms_rec left join LMAcquireParams on (LMAcquireParams.detector_id=" + l.ToString() + ") " + "where (acquire_parms_rec.meas_detector_id=" + SQLSpecific.Value(measDetId, true) + ")" + " order by acquire_parms_rec.MeasDate DESC"; DataTable dt = db.DT(sSQL); return(dt); }
private DataTable AllWithKeyNames(string DetectorName) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); string sSQLa = "Select * from CountingParams where CountingParams.detector_id=" + l.ToString(); string sSQLb = "Select * from LMMultiplicity where LMMultiplicity.detector_id=" + l.ToString(); DataTable dta = db.DT(sSQLa); DataTable dtb = db.DT(sSQLb); dta.Merge(dtb); return(dta); }
// return the named stratum associated with a detector public DataTable Get(string measDetId, string stratumId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); long m = PrimaryKey(stratumId); string sSQL = "Select * FROM stratum_ids INNER JOIN stratum_id_detector ON " + "(stratum_id_detector.stratum_id=stratum_ids.stratum_id AND stratum_id_detector.detector_id=" + l.ToString() + " AND stratum_id_detector.stratum_id=" + m.ToString() + ")"; DataTable dt = db.DT(sSQL); return(dt); }
private string ResolvedKey(string val, IDB _db) { Detectors dets = new Detectors(_db); if (Id) { long l = dets.PrimaryKey(val); return(Field + "=" + l.ToString()); } else { return(Field + "=" + SQLSpecific.Value(val, true)); } }
// return the stratums associated with a detector public DataTable GetAssociations(string measDetId) { if (String.IsNullOrEmpty(measDetId)) { return(Get()); } db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * FROM stratum_ids INNER JOIN stratum_id_detector ON (stratum_id_detector.stratum_id=stratum_ids.stratum_id AND stratum_id_detector.detector_id=" + l.ToString() + ")"; DataTable dt = db.DT(sSQL); return(dt); }
public bool Update(string measDetId, string table, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); if (table == "net") { return(UpdateNetComm(l, sParams, db)); } else { return(UpdateCfg(l, sParams, db)); } }
// create a stratum and detector stratum association public bool Create(string measDetId, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = InsertStratum(sParams); ArrayList sqlList = new ArrayList(); sqlList.Add(sSQL); sqlList.Add(SQLSpecific.getLastID("stratum_ids")); long newID = db.ExecuteTransactionID(sqlList); string saSQL = "insert into stratum_id_detector VALUES(" + l.ToString() + "," + newID.ToString() + ")"; return(db.Execute(saSQL)); }
public bool Update(string DetectorName, string CounterType, ElementList sParams) { DataRow dr = null; string table = "CountingParams"; if (CounterType.Equals("Multiplicity") || CounterType.Equals("Coincidence")) { table = "LMMultiplicity"; } Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return(false); } if (table.Equals("LMMultiplicity")) { dr = HasRow(DetectorName, CounterType, table, sParams[faidx].Value); // the FA parameter } else { dr = HasRow(DetectorName, CounterType, table); } if (dr == null) { sParams.Add(new Element("detector_id", l)); string sSQL = "Insert into " + table; sSQL += sParams.ColumnsValues; return(db.Execute(sSQL)); } else { //NEXT: not tested(?) string sSQL = "UPDATE " + table + " SET "; sSQL += (sParams.ColumnEqValueList + " where counter_type=" + SQLSpecific.QVal(CounterType) + " AND detector_id=" + l.ToString()); if (table.Equals("LMMultiplicity")) { sSQL += " AND " + sParams[faidx].Name + "=" + sParams[faidx].Value; } return(db.Execute(sSQL)); } }
public long DeleteAll(string DetectorName) { Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return(-1); } string table1 = "CountingParams"; string table2 = "LMMultiplicity"; ArrayList sqlList = new ArrayList(); sqlList.Add("DELETE FROM " + table1 + " where detector_id=" + l.ToString()); sqlList.Add("DELETE FROM " + table2 + " where detector_id=" + l.ToString()); return(db.Execute(sqlList)); }
// fix this, need a blanket clear public bool DeleteAll(string DetectorName, string CounterType, ElementList sParams) { DataRow dr = null; string table = "CountingParams"; if (CounterType.Equals("Multiplicity") || CounterType.Equals("Coincidence")) { table = "LMMultiplicity"; } Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return(false); } if (table.Equals("LMMultiplicity")) { dr = HasRow(DetectorName, CounterType, table, sParams[faidx].Value); // the FA parameter } else { dr = HasRow(DetectorName, CounterType, table); } if (dr != null) { //NEXT: not tested(?) string sSQL = "DELETE FROM " + table + " where counter_type=" + SQLSpecific.QVal(CounterType) + " AND detector_id=" + l.ToString(); if (table.Equals("LMMultiplicity")) { sSQL += " AND " + sParams[faidx].Name + "=" + sParams[faidx].Value; } return(db.Execute(sSQL)); } else { return(true); } }
public bool Insert(string DetectorName, string CounterType, ElementList sParams) { DataRow dr = null; string table = "CountingParams"; if (CounterType.Equals("Multiplicity") || CounterType.Equals("Coincidence")) { table = "LMMultiplicity"; } Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return(false); } if (table.Equals("LMMultiplicity")) { dr = HasRow(l, CounterType, table, sParams, sParams[faidx].Value); // the FA parameter } else { dr = HasRow(l, CounterType, table, sParams); } if (dr == null) { sParams.Add(new Element("detector_id", l)); string sSQL = "Insert into " + table; sSQL += sParams.ColumnsValues; return(db.Execute(sSQL)); } else { // identical row found, skip it return(false); } }
public bool Update(string DetectorName, string CounterType, ElementList sParams) { DataRow dr = null; string table = "CountingParams"; if (CounterType.Equals("Multiplicity") || CounterType.Equals("Coincidence")) table = "LMMultiplicity"; Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return false; } if (table.Equals("LMMultiplicity")) dr = HasRow(DetectorName, CounterType, table, sParams[faidx].Value); // the FA parameter else dr = HasRow(DetectorName, CounterType, table); if (dr == null) { sParams.Add(new Element("detector_id", l)); string sSQL = "Insert into " + table; sSQL += sParams.ColumnsValues; return db.Execute(sSQL); } else { //NEXT: not tested(?) string sSQL = "UPDATE " + table + " SET "; sSQL += (sParams.ColumnEqValueList + " where counter_type=" + SQLSpecific.QVal(CounterType) + " AND detector_id=" + l.ToString()); if (table.Equals("LMMultiplicity")) sSQL += " AND " + sParams[faidx].Name + "=" + sParams[faidx].Value; return db.Execute(sSQL); } }
public bool Update(string DetectorName, string ItemType, ElementList sParams) { bool res = false; db.SetConnection(); //NEXT: this duo-lookup part takes too long, so get the values once in a wrapper call, then cache them, then reuse them DataRow dr = HasRow(DetectorName, ItemType); // sets the connection Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); Descriptors mats = new Descriptors("material_types", db); long m = mats.PrimaryKey(ItemType); if (l == -1 || m == -1) { DBMain.AltLog(LogLevels.Warning, 70130, "Missing Det/Mat keys ({0},{1}) selecting AnalysisMethods", l, m); return(false); } if (dr == null) // a new entry! { string sSQL = "insert into analysis_method_rec "; sParams.Add(new Element("item_type_id", m)); sParams.Add(new Element("analysis_method_detector_id", l)); sSQL = sSQL + sParams.ColumnsValues; res = db.Execute(sSQL); } else { string wh = " where item_type_id= " + m.ToString() + " AND analysis_method_detector_id=" + l.ToString(); string sSQL1 = "UPDATE analysis_method_rec SET "; string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; res = db.Execute(sSQL); } return(res); }
public bool Update(string DetectorName, string ItemType, ElementList sParams) { bool res = false; db.SetConnection(); //NEXT: this duo-lookup part takes too long, so get the values once in a wrapper call, then cache them, then reuse them DataRow dr = HasRow(DetectorName, ItemType); // sets the connection Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); Descriptors mats = new Descriptors("material_types", db); long m = mats.PrimaryKey(ItemType); if (l == -1 || m == -1) { DBMain.AltLog(LogLevels.Warning, 70130, "Missing Det/Mat keys ({0},{1}) selecting AnalysisMethods", l, m); return false; } if (dr == null) // a new entry! { string sSQL = "insert into analysis_method_rec "; sParams.Add(new Element("item_type_id", m)); sParams.Add(new Element("analysis_method_detector_id", l)); sSQL = sSQL + sParams.ColumnsValues; res = db.Execute(sSQL); } else { string wh = " where item_type_id= " + m.ToString() + " AND analysis_method_detector_id=" + l.ToString(); string sSQL1 = "UPDATE analysis_method_rec SET "; string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; res = db.Execute(sSQL); } return res; }
public bool Delete(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL1 = "DELETE from " + table; string sSQL1i = String.Empty; string wh = " where " + "detector_id = " + l.ToString(); string sSQL = sSQL1 + wh; return db.Execute(sSQL); }
// return the stratums associated with a detector public DataTable GetAssociations(string measDetId) { if (String.IsNullOrEmpty(measDetId)) return Get(); db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * FROM stratum_ids INNER JOIN stratum_id_detector ON (stratum_id_detector.stratum_id=stratum_ids.stratum_id AND stratum_id_detector.detector_id=" + l.ToString() + ")"; DataTable dt = db.DT(sSQL); return dt; }
public bool Associate(string measDetId, string stratumID) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); long m = PrimaryKey(stratumID); string saSQL = "insert into stratum_id_detector VALUES(" + l.ToString() + "," + m.ToString() + ")"; return db.Execute(saSQL); }
// create a stratum and detector stratum association public bool Create(string measDetId, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = InsertStratum(sParams); ArrayList sqlList = new ArrayList(); sqlList.Add(sSQL); sqlList.Add(SQLSpecific.getLastID("stratum_ids")); long newID = db.ExecuteTransactionID(sqlList); string saSQL = "insert into stratum_id_detector VALUES(" + l.ToString() + "," + newID.ToString() + ")"; return db.Execute(saSQL); }
// delete all the stratum associations with a detector public bool Unassociate(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "DELETE FROM stratum_id_detector where " + "(stratum_id_detector.detector_id=" + l.ToString() + ")"; return db.Execute(sSQL); }
// return the named stratum associated with a detector public DataTable Get(string measDetId, string stratumId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); long m = PrimaryKey(stratumId); string sSQL = "Select * FROM stratum_ids INNER JOIN stratum_id_detector ON " + "(stratum_id_detector.stratum_id=stratum_ids.stratum_id AND stratum_id_detector.detector_id=" + l.ToString() + " AND stratum_id_detector.stratum_id=" + m.ToString() + ")"; DataTable dt = db.DT(sSQL); return dt; }
public bool Has(string DetectorName, string CounterType) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); string sSQL = "Select * from INNER JOIN LMMultiplicity, CountingParams ON (LMMultiplicity.detector_id=CountingParams.detector_id) " + "where detector_id=" + l.ToString() + " AND " + "counter_type=" + SQLSpecific.QVal(CounterType); DataTable dt = db.DT(sSQL); return (dt.Rows.Count > 0); }
private DataTable AllWithKeyNames(string DetectorName) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); string sSQLa = "Select * from CountingParams where CountingParams.detector_id=" + l.ToString(); string sSQLb = "Select * from LMMultiplicity where LMMultiplicity.detector_id=" + l.ToString(); DataTable dta = db.DT(sSQLa); DataTable dtb = db.DT(sSQLb); dta.Merge(dtb); return dta; }
private DataTable BasicSelect(string DetectorName, string CounterType, string table, string FA) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); return GetTable(l, CounterType, table, FA); }
public bool Insert(string DetectorName, string CounterType, ElementList sParams) { DataRow dr = null; string table = "CountingParams"; if (CounterType.Equals("Multiplicity") || CounterType.Equals("Coincidence")) table = "LMMultiplicity"; Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return false; } if (table.Equals("LMMultiplicity")) dr = HasRow(l, CounterType, table, sParams, sParams[faidx].Value); // the FA parameter else dr = HasRow(l, CounterType, table, sParams); if (dr == null) { sParams.Add(new Element("detector_id", l)); string sSQL = "Insert into " + table; sSQL += sParams.ColumnsValues; return db.Execute(sSQL); } else { // identical row found, skip it return false; } }
private string ResolvedKey(string val, IDB _db) { Detectors dets = new Detectors(_db); if (Id) { long l = dets.PrimaryKey(val); return Field + "=" + l.ToString(); } else { return Field + "=" + SQLSpecific.Value(val, true); } }
public bool Update(string measDetId, string item_type, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL1 = "UPDATE LMAcquireParams SET "; string sSQL1i = String.Empty; string wh = " where " + "item_type = " + SQLSpecific.Value(item_type, true) + " AND detector_id = " + l.ToString(); string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; return db.Execute(sSQL); }
public DataTable Get(DateTimeOffset measDatetime, string measDetId, string item_type) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * FROM LMAcquireParams where detector_id = " + l.ToString() + " AND item_type=" + SQLSpecific.Value(item_type, true); DataTable dt = db.DT(sSQL); return dt; }
public bool Update(string measDetId, string table, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); if (table == "net") return UpdateNetComm(l, sParams, db); else return UpdateCfg(l, sParams, db); }
public DataTable Get(string measDetId) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * from LMNetComm, LMHWParams where (LMNetComm.detector_id=" + l.ToString() + " AND LMHWParams.detector_id=" + l.ToString() +")"; DataTable dt = db.DT(sSQL); return dt; }
public long DeleteAll(string DetectorName) { Detectors dets = new Detectors(db); long l = dets.PrimaryKey(DetectorName); if (l == -1) { DBMain.AltLog(LogLevels.Warning, 70137, "Missing Det key ({0}) selecting CountingParams", l); return -1; } string table1 = "CountingParams"; string table2 = "LMMultiplicity"; ArrayList sqlList = new ArrayList(); sqlList.Add("DELETE FROM " + table1 + " where detector_id=" + l.ToString()); sqlList.Add("DELETE FROM " + table2 + " where detector_id=" + l.ToString()); return db.Execute(sqlList); }