C# stored procedure with parameters

前端 未结 9 2372
误落风尘
误落风尘 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:23

    The issue is on this line:

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

    You are passing the task object in instead of the name of the task.

提交回复
热议问题