I am getting the following error:-
Subquery returned more than 1 value. This is not permitted when the subquery
follows =, !=, <, <= , >, >= or when the subquery is used as an
expression.
Subquery returned more than 1 value. This is not permitted when
the subquery follows =, !=, <, <= , >, >= or when the subquery is
used as an expression.
protected IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior)
{
return cmd.ExecuteReader(behavior);
}
This happens when I try to login and I have noticed that if the user closes the window without logging out this happens. If it happens with a username once, that username can never be used. Whenever I try to login with that username I will get this error.
So, it is a serious problem. Can anyone help me to fix this?
I am using create userwizard to create user and login view to login into the site.
Thanks
r pPosted Dec 30, 2008, 8:35 AM
Yes,
In my stored procedure I have statements like-
SELECT CONVERT(VARCHAR(50),m.CreateDate, 107) AS [Mon]
FROM dbo.aspnet_Users u, dbo.aspnet_Membership m WHERE u.UserName = @username
SELECT m.LastLoginDate
FROM dbo.aspnet_Users u, dbo.aspnet_Membership m WHERE u.UserName = @username
I tried to run it mannually and I am getting more than one row for each of the above statements. Sometimes I delete users from the 'Website Administration Tool provided by ASP.NET2.
So, it may not be deleting the details of creation date and last login date.
Now, I modified the statement with MAX as follows:-
SELECT CONVERT(VARCHAR(50),MAX(m.CreateDate), 107) AS [Mon]
FROM dbo.aspnet_Users u, dbo.aspnet_Membership m WHERE u.UserName = @username
SELECT MAX(m.LastLoginDate)
FROM dbo.aspnet_Users u, dbo.aspnet_Membership m WHERE u.UserName = @username
It looks working fine. Is this the right way of doing?
I am trying to get the date of joining the website and last login date.
Thanks