application program parameters for the current request are not valid. reason code 03. SQLSTATE: 07002, SQLCODE: -804

梦想的初衷 提交于 2019-12-25 12:38:25

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!