User1215150307 posted
i checked that all parameters i passed are correct which are changed from not using enterprise library,
now i use enterprise library, it pop up an error Procedure or function sp_Batch_Update has too many arguments specified. error at if (defaultDB.ExecuteNonQuery(command) == 1)
Why? How to know which paramter is more?
DbCommand command = defaultDB.GetStoredProcCommand(stored_procedure_name);
command = class_name.FillParameters(defaultDB, command);
public DbCommand FillParameters(Database defaultDB, DbCommand command)
{
//defaultDB.AddInParameter(cmdA, "description", DbType.String, newRow53Value);
defaultDB.AddInParameter(command, "BatchID", DbType.Int32, Batchid);
defaultDB.AddOutParameter(command, "BatchID", DbType.Int32, 65536);
defaultDB.AddInParameter(command, "CurrentAccountID", DbType.Int32, Currentaccountid);
defaultDB.AddInParameter(command, "BatchNo", DbType.String, Batchno);
defaultDB.AddInParameter(command, "Remarks", DbType.String, Remarks);
DateTime nullvalue = new DateTime(1755, 1, 1, 0, 0, 0);
if (Issuedate == nullvalue)
defaultDB.AddInParameter(command, "IssueDate", DbType.DateTime, System.DBNull.Value);
else
defaultDB.AddInParameter(command, "IssueDate", DbType.DateTime, Issuedate.ToString("yyyy/MM/dd HH:mm:ss"));
if (Chequedate == nullvalue)
defaultDB.AddInParameter(command, "ChequeDate", DbType.DateTime, System.DBNull.Value);
else
defaultDB.AddInParameter(command, "ChequeDate", DbType.DateTime, Chequedate.ToString("yyyy/MM/dd HH:mm:ss"));
defaultDB.AddInParameter(command, "CompanyCode", DbType.String, Companycode);
defaultDB.AddInParameter(command, "CompanyName", DbType.String, Companyname);
defaultDB.AddInParameter(command, "BankCode", DbType.String, account_code);
defaultDB.AddInParameter(command, "BankName", DbType.String, Bankname);
defaultDB.AddInParameter(command, "Contact_Person", DbType.String, Contact_person);
defaultDB.AddInParameter(command, "Urgent", DbType.Int32, Convert.ToInt32(Urgent));
return command;
}