How to set unnamed SQL parameters in SqlCommand

前端 未结 2 1214
独厮守ぢ
独厮守ぢ 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)

    0 讨论(0)
  • 2021-01-13 15:32

    Use ADODBConnection and ADODBCommand instead of SQL versions.

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