“Parameter ?_1 has no default value” error when ExecuteReader

后端 未结 4 1282
情深已故
情深已故 2021-01-26 04:10

Having problem with the code below in a web service. Have searched for a solution but nothing that I have seen seems different to what I am doing below.

NB: The

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-26 04:26

    What you have looks correct with the "?" as the parameter place-holder for the parameters added to the command. You currently have the parameter identified as OleDbType.VarWChar. Is that intended? Are you dealing with unicode data? I suspect not in this case. Try changing to OleDbType.Char which also is represented to handle System.String values.

    You could also make sure you are getting a string by using

    AccountNo.ToString()

提交回复
热议问题