C# stored procedure with parameters

前端 未结 9 2394
误落风尘
误落风尘 2020-12-10 11:49

I am receiving an error in my application and i can not figure out how to resolve it. Here is the code:

SqlConnection myConnection = new SqlConnection(Confi         


        
9条回答
  •  一整个雨季
    2020-12-10 12:24

    On the line:

    myCommand2.Parameters.Add("@TaskName", SqlDbType.NVarChar, 50).Value = t;
    

    't' is a task, not a string. You need to get the task name instead (by the looks of it)

提交回复
热议问题