An SqlParameter with ParameterName '@UserId' is not contained by this SqlParameterCollection

后端 未结 4 1679
清酒与你
清酒与你 2021-01-15 14:36

I had a login page. once user successfuly logged in, they can view and manage their profile/information. This would be done by retrieving data from database and display on a

4条回答
  •  借酒劲吻你
    2021-01-15 15:26

    Try the following:

    DbParameter param = e.Command.CreateParameter();
    param.ParameterName = "@UserId";
    param.Value = currentUserId;
    e.Command.Parameters.Add(param);
    

    I didn't test this though

提交回复
热议问题