Ask a Question related to ASP.NET Security, Design and Development.
-
Patrick.O.Ige #1
Error with cmdQuestion.ExecuteReader(out dr);
I have a code PASTED below.Its validate(login) against a database SQL
SERVER.
But i have a problem with the LINE:- "cmdQuestion.ExecuteReader(out dr);"
below
its says ERROR :-
"The best overloaded method match for
'System.Data.SqlClient.SqlCommand.ExecuteReader(Sy stem.Data.CommandBehavior)
' has some invalid arguments"
Can anybody help?
-------------------------------------------------------------
// Create a command to get the question
SqlCommand cmdQuestion = new SqlCommand("SELECT Password FROM Users WHERE
Email = '" + Email.Text + "'", cn);
// Create a datareader to get the question
//myCommand.ExecuteReader();
cmdQuestion.ExecuteReader(out dr);
// Get the first row
if(dr.Read())
if(dr["Password"].ToString() == Password.Text)
CookieAuthentication.RedirectFromLoginPage(Email.T ext, false);
else
Msg.Text = "Invalid password.";
else
Msg.Text = "Email address not found.";
}
}
Patrick.O.Ige Guest
-
Error 403 Failed to read heders Error for long-runningCFMAIL and CFINDEX command
I have two different pages with long-running scripts on which I am recieving the following error: Error - 403 Failed to read headers to server:... -
System.InvalidOperationException: ExecuteReader: Connection property has not been initialized
Hello, I dont understand whats going on with my DB2 connector. I used to have the code in a class that worked fine. But when I tried to use it in a... -
Error Creating Control: Parser Error DocHeader does not have a property named 'cc3:MyItems'
I am having problems getting this webcontrol working properly. Everything else works fine except having items. So here is the low-down on the... -
An error occurred while try to load the string resources (GetModuleHandle failed with error -2147023888)
Hello, on one of our customers servers we get following error on first ASPX-page: An error occurred while try to load the string resources... -
"Internal connection fatal error" when calling SQLCommand.ExecuteReader
We are getting this error intermittently (about 5-10 times an hour) from one of our applications. It is not restricted to any particular page or... -
David Coe, MCP #2
RE: Error with cmdQuestion.ExecuteReader(out dr);
Patrick
The ExecuteReader method only has two signatures -- one with no parameters, and one with a CommandBehavior parameter. If you are trying to compare the passwords, then you can also do something like
SqlDataReader reader = cmdQuestion.ExecuteReader()
while(reader.Reader()
if(reader["Password"] == Password.Text
// do something vali
els
// do something invali
}
David Coe, MCP Guest



Reply With Quote

