Tag: mysql error 1064

此SqlParameterCollection不包含带有ParameterName’@ UserId’的SqlParameter

我有一个登录页面。 一旦用户成功登录,他们就可以查看和管理他们的个人资料/信息。 这可以通过从数据库中检索数据并在formview上显示来完成。 但是,我的userprofile.aspx.cs文件中出现以下错误: Exception Details: System.IndexOutOfRangeException: An SqlParameter with ParameterName ‘@UserId’ is not contained by this SqlParameterCollection. Source Error: Line 44: Line 45: // Assign the currently logged on user’s UserId to the @UserId parameter Line 46: e.Command.Parameters[“@UserId”].Value = currentUserId; Line 47: Line 48: } Userprofile.aspx: UserId: <asp:Label ID="UserIdLabel1" runat="server" Text='’ /> Password: <asp:TextBox […]