i save values which are selected from calender in asp. Then in need to count the record which are equal to that date. How can i do it?
this is the method
public bool CheckSeatAvailable() {
string com = "SELECT SUM(boknoofseats) FROM Tbl_booking WHERE boktheaid='" + theatureid + "' AND bokmovid='" + movieid + "' AND boktime='" + int.Parse(boktime.SelectedValue) + "' AND bokdate = '"+Calendar1.SelectedDate.ToString("yyyy-MM-dd")+"'";
conn.Open();
SqlCommand comm = new SqlCommand(com,conn);
SqlDataReader rd = comm.ExecuteReader();
rd.Read();
seatavail = int.Parse(rd[0].ToString());
conn.Close();
if (seatavail < GetNoOfSeats())
{
checkseat = true;
}
else {
checkseat = false;
}
return checkseat;
}
Go to the complete details ...