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

后端 未结 4 1750
清酒与你
清酒与你 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:24

    If you already have the parameter listed in your SqlDataSource, then simply point to it and change it's value ...

    e.Command.Parameters["@UserId"].Value = currentUserId;
    

    You do not need to create a parameter, unless you have not listed it back in your ASP page.

提交回复
热议问题