“SqlParameterCollection only accepts non-null SqlParameter type objects, not String objects”

后端 未结 8 2004
暗喜
暗喜 2021-01-04 07:23

I keep getting the exception

The SqlParameterCollection only accepts non-null SqlParameter type objects, not String objects

, while execut

8条回答
  •  醉酒成梦
    2021-01-04 07:37

    I had been getting the same error and had to use AddWithValue like this...

    cmd.Parameters.AddWithValue(@columnToUpdate, newValue);
    cmd.Parameters.AddWithValue(@conditionalColumn, conditionalValue);
    

提交回复
热议问题