Binding parameters to OLEDB command throws error

后端 未结 1 1786
时光取名叫无心
时光取名叫无心 2021-01-28 23:52

I am using AS 400 OLEDB with .NET. It uses \'?\' instead of \'@param to bind parameters with a command Now there is a situation where the command is like

SELECT          


        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-29 00:45

    Try changing the names of the parameters

    myCommand.Parameters.Add(new OleDbParameter("@startRowIndex",startRowIndex));
    myCommand.Parameters.Add(new OleDbParameter("@startRowIndex2", startRowIndex));
    myCommand.Parameters.Add(new OleDbParameter("@MaximumRows", MaximumRows));
    

    but leave the SQL as is.

    0 讨论(0)
提交回复
热议问题