Last post Jul 18, 2008 12:04 PM by dswersky
Jul 18, 2008 11:59 AM|mkahn2|LINK
I am writing the code to authinticate a users login, i.e. verify the password, i am using an asp:Login control and have the following code:
OleDbConnection objConn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;" + "Data Source=\"" + Request.PhysicalApplicationPath + "App_Data\\thedb.mdb\"");
OleDbCommand objCmd = new OleDbCommand("SELECT THE_PASSWORD FROM MEMBER WHERE MEMBER_ID =@MEMBER_ID", objConn);
OleDbDataReader objRdr = objCmd.ExecuteReader();
string password = objRdr["THE_PASSWORD"].ToString();
and when I test it an InvalidOperationException is thrown at the last line with the following note: No data exists for the row/column.
Where should I start debugging? Ive opened the db to ensure that there is MEMBER table and that MEMBER_ID and THE_PASSWORD are fields and that they are indeed filled.
Jul 18, 2008 12:04 PM|dswersky|LINK
Add this line before the last line in your code: