Y
yossimotro
OleDbConnection con;
OleDbCommand cmd;
OleDbDataReader reader;
con = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
Server.MapPath("App_Data\\db.mdb") + ";");
con.Open();
cmd = new OleDbCommand("Select tblUsers.userID from tblUsers
WHERE tblUsers.Login = ? AND tblUsers.Password = ?", con);
cmd.Parameters.Add("Login", txtUser.Text.ToString());
cmd.Parameters.Add("Password", txtPass.Text.ToString());
reader = cmd.ExecuteReader();
---------------------------------------------------------
After this is executed I get the following error:
No value given for one or more required parameters.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: No value given for
one or more required parameters.
Source Error:
Line 42:
Line 43:
Line 44: reader = cmd.ExecuteReader();
Line 45:
Line 46:
What could be the cause of it?
Yossi.
OleDbCommand cmd;
OleDbDataReader reader;
con = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
Server.MapPath("App_Data\\db.mdb") + ";");
con.Open();
cmd = new OleDbCommand("Select tblUsers.userID from tblUsers
WHERE tblUsers.Login = ? AND tblUsers.Password = ?", con);
cmd.Parameters.Add("Login", txtUser.Text.ToString());
cmd.Parameters.Add("Password", txtPass.Text.ToString());
reader = cmd.ExecuteReader();
---------------------------------------------------------
After this is executed I get the following error:
No value given for one or more required parameters.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: No value given for
one or more required parameters.
Source Error:
Line 42:
Line 43:
Line 44: reader = cmd.ExecuteReader();
Line 45:
Line 46:
What could be the cause of it?
Yossi.