SQL Query says a parameter is not supplied, but is added to the SqlCommand object

后端 未结 4 647
南旧
南旧 2020-12-17 09:24

I have a stored procedure that has a parameter called UserName and in my code behind I have a SqlCommand object that I add the parameters to with the Add method. But for som

4条回答
  •  再見小時候
    2020-12-17 10:01

    Command1.CommandType = System.Data.CommandType.StoredProcedure
    

    This will force the ExecuteReader to perform the exec instead of just trying it as a flat command.

提交回复
热议问题