- 论坛徽章:
- 0
|
public DataSet QueryJobInstruction(string sID, string sCheckItem, string sShopNo, string sProcedure, string sDeviceNo)
{
OdbcDataAdapter theAdapter = new OdbcDataAdapter();
DataSet data = new DataSet();
try
{
string strSQL = "";
strSQL = @"select * from standardjobinstruction,shopinfo b,chcekdevice c,procedure e where a.shopno=b.shopno and a.checkdeviceno=c.checkdeviceno and a.shopno=e.shopno";
if (sID != "") strSQL = strSQL + " and a.jobno ='" + sID + "'";
if (sCheckItem != "") strSQL = strSQL + " and a.checkitem ='" + sCheckItem + "'";
if (sShopNo != "") strSQL = strSQL + " and a.checkshopno ='" + sShopNo + "'";
if (sProcedure != "") strSQL = strSQL + " and a.procedureno ='" + sProcedure + "'";
if (sDeviceNo != "") strSQL = strSQL + " and a.checkdeviceno ='" + sDeviceNo + "'";
OdbcCommand commandDtl3 = new OdbcCommand(strSQL, conn);
theAdapter.SelectCommand = commandDtl3;
theAdapter.Fill(data, "standardjobinstruction");
}
catch (System.Exception e)
{
throw e;
}
finally
{
theAdapter.Dispose();
theAdapter = null;
}
return data;
} |
我这个查询函数写的怎么了,报错了 |
|