问题
I'm working on a desktop application and using OLEDB providers to connect to DB2 database. The below query is successful for few accounts and not working for few accounts
Working account numbers - 1004423,1008647,1008655,1009283,1031556
Failed account numbers - 1023088,1025238,1026210,1029648,1031169
Customer number is same for all the accounts. Any ideas why these account numbers are getting failed?
OleDbConnection conn = new OleDbConnection("ConnectionString");
conn.Open();
DbTransaction trans = conn.BeginTransaction();
ConnectionInfo connInfo = new ConnectionInfo(trans);
DBCommandWrapper cmdAcct = DBCommandWrapperFactory.CreateDBCommandWrapper(connInfo.Connection, "TAccount", connInfo.Transaction);
cmdAcct.SetParameterValue("@IN_Custno", custNumber);
cmdAcct.SetParameterValue("@IN_Account", Convert.ToDouble(accountNum.Trim()));
RowsAffected = cmdAcct.CommandObject.ExecuteNonQuery();
Update statement specified in config file,
<command name="TAccount" commandType="Text">
<commandText>
UPDATE #.Account1
SET CUSTNO = ?,
TAG = 'M'
WHERE ACCOUNTNO = ?
</commandText>
<parameters>
<parameter name="@IN_Custno" dbType="Decimal" scale="0" precision="0" size="0" direction="Input" value="" isNullable="false" sourceColumn="" sourceVersion="Default" />
<parameter name="@IN_Account" dbType="Double" scale="0" precision="0" size="0" direction="Input" value="" isNullable="false" sourceColumn="" sourceVersion="Default" />
</parameters>
</command>
来源:https://stackoverflow.com/questions/47789731/application-program-parameters-for-the-current-request-are-not-valid-reason-cod