/// <summary> /// 功能描述 : 查询最低检出限 /// 创建者 : 黄成 /// 创建日期 : 2011-12-14 /// 修改者 : /// 修改日期 : /// 修改原因 : /// </summary> /// <returns>bool</returns> public string GetSenseNameBytbl(string tbl, string code) { try { tbl = "tbl" + tbl + "_Item"; string sql = " select fldSense ,flditemName from " + tbl + " where fldItemCode = " + code; usp_execSqlText usp = new usp_execSqlText(); usp.sqlText = sql; DataTable dt = usp.ExecDataTable(); if (dt == null) { throw new Exception("没有查询到数据!"); } return(dt.Rows[0]["fldSense"].ToString() + "~" + dt.Rows[0]["flditemName"].ToString()); } catch (DBOpenException e) { throw new GetListException("打开数据库连接失败", "RuletblEQI_publi", "usp_execSqlText", "tbl:" + tbl.ToString()); } catch (DBQueryException e) { throw new GetListException("执行Sql语句失败", "RuletblEQI_publi", "usp_execSqlText", "tbl:" + tbl.ToString()); } catch (Exception e) { throw new GetListException(e.Message, "RuletblEQI_publi", "usp_execSqlText", "tbl:" + tbl.ToString()); } }
public DataTable getData(string cx, string tbl, string strwhere, string strorder) { try { string sql = " select " + cx + " from " + tbl + " where " + strwhere + " order by " + strorder; usp_execSqlText usp = new usp_execSqlText(); usp.sqlText = sql; DataTable dt = usp.ExecDataTable(); return(dt); } catch (Exception ex) { throw ex; } }
public DataTable getdt(string sql) { try { usp_execSqlText usp = new usp_execSqlText(); usp.sqlText = sql; DataTable dt = usp.ExecDataTable(); return(dt); } catch (DBOpenException) { throw new GetListException("打开数据库连接失败", "RuletblEQI_publi", "getdt", "sql:" + sql); } catch (DBQueryException) { throw new GetListException("执行Sql语句失败", "RuletblEQI_publi", "getdt", "sql:" + sql); } catch (Exception e) { throw new GetListException(e.Message, "RuletblEQI_publi", "getdt", "sql:" + sql); } }