How to set unnamed SQL parameters in SqlCommand

前端 未结 2 1215
独厮守ぢ
独厮守ぢ 2021-01-13 14:50

If I add unnamed parameters to my SqlCommand, how do I set the parameter values, on the SqlCommand?

I have no problems when I use named parameters, wher

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-13 15:18

    With ADO.NET against SQL Server, you cannot use those ? for parameters - you always have to use @paramName approach.

    The ? for unnamed parameters is an ODBC "left-over" but not supported in ADO.NET when using SQL Server (not sure about MS-Access)

提交回复
热议问题