parthiban karnan

parthiban karnan

  • NA
  • 549
  • 101.2k

code not working

Apr 17 2013 9:32 AM
i tried the below code for restricting no of daily bookings to 10.. but did'nt work..

records inserting after 10

public DataSet GetEmployees()
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=EmpDB;User ID=sa;Password=sa");
con.Open();
SqlCommand cmd = new SqlCommand("Select count(ID) from carbookingdetails where createdon=Getdate()", con);
intCount= cmd.ExecuteScalar()
if (intCount>10)
alert("Booking is over for today");
else
{
//do Insertion Process in carbookdetails table.
}

Answers (13)