Public DataTable ExactOrderSearch (int IntOrderID, int IntNF, string strName, int IntIsConfirm, int IntIsSend, int IntIsEnd)
{
//execute the stored procedure call GetCommandProc DBClass class method, return to Sqlcommand object
SqlCommand myCmd=dbObj. GetCommandProc (" Proc_SearchOI ");
//add parameters - order number
SqlParameter orderID=new SqlParameter (" @ orderID ", SqlDbType. Int, 4);
OrderID Value=https://bbs.csdn.net/topics/IntOrderID;
MyCmd. The Parameters. The Add (orderID);
//add parameters - logo whether to fill in the consignee name
SqlParameter nf=new SqlParameter (" @ nf ", SqlDbType. Int, 4);
Nf. Value=https://bbs.csdn.net/topics/IntNF;
MyCmd. The Parameters. The Add (nf);
//add parameters - the consignee name
SqlParameter name=new SqlParameter (" @ the name ", SqlDbType VarChar, 50);
The name Value=https://bbs.csdn.net/topics/strName;
MyCmd. The Parameters. The Add (name);
//add parameters - whether confirm
SqlParameter confirm=new SqlParameter (" @ IsConfirm ", SqlDbType. Int, 4);
Confirm the Value=https://bbs.csdn.net/topics/IntIsConfirm;
MyCmd. The Parameters. The Add (confirm); ;
//add parameters, whether the delivery
SqlParameter send=new SqlParameter (" @ IsSend ", SqlDbType. Int, 4);
Send. Value=https://bbs.csdn.net/topics/IntIsSend;
MyCmd. The Parameters. The Add (send);
//add parameters - whether archive
SqlParameter end=new SqlParameter (" @ IsEnd ", SqlDbType. Int, 4);
End Value=https://bbs.csdn.net/topics/IntIsEnd;
MyCmd. The Parameters. The Add (end);
//call DBClass GetDataSet method of filling the SQL query, return a collection of data sets of tables
The DataTable dsTable=dbObj. GetDataSet (myCmd, "tbOI");
Return dsTable;
}
The stored procedure how to write things, need not to need the if exsits what of, can't see because no NF the column in the table, and the consignee is not
Named the Name directly, in the table is ReceiverName, I want correct according to the table or in accordance with the code to not change?
CodePudding user response:
There didn't say the Name or NF such columns, just have such parameters,Maybe the code is written ReceiverName=@ Name this
?
You'll have to see what I look like a stored procedure code
CodePudding user response:
Empty several parameters, write not to come out, don't know the logicCodePudding user response:
long time no seeCodePudding user response:
These are all parameters, not the column nameDon't have to change
You run directly, see if there is any error
CodePudding user response: