SQL Server error “Procedure expects parameter”

后端 未结 1 443
被撕碎了的回忆
被撕碎了的回忆 2021-01-22 11:57

I\'m writing a login script. But when I want to check if user already exist the error:

Additional information: Procedure or function \'checkIfUserExcist\

1条回答
  •  清酒与你
    2021-01-22 12:41

    You need to tell your SqlCommand that it uses a stored procedure - like this:

    SqlCommand com = new SqlCommand("checkIfUserExcist", conn);
    -- add this line here
    com.CommandType = CommandType.StoredProcedure;
    com.Parameters.AddWithValue("@username", username);
    

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