Database as follows
studentid crbillno DOM
133 124290 20-01-2014
In run mode screen as follows
Batch Date 28-06-2014
i have one button called Submit.
When i click the submit i want to validate dropdownlist date must be less than DOB date(DOM).
for that my code as follows
DateTime coursedate;
coursedate = Convert.ToDateTime(DdlBthDates.SelectedItem.Text.ToString());
Sql = "select DOM from course where stud_id = '" + Session["stud_id"] + "' and CR_BILL_NO = '" + Session["cr_bill_no"] + "'";
coursedr = drr.ExecRdr(Sql);
if (coursedate < Convert.ToDateTime(coursedr[0].ToString().Trim()))
{
Label23.Text = "date must be ";
return;
}
coursedr.Close();
when i run the code shows error as follows
Invalid attempt to read no data present.
the error shows in below line as follows
if (coursedate < Convert.ToDateTime(coursedr[0].ToString().Trim()))