Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
code not working
May 01, 2013
here below have a code for restricting booking limit to 10 per day..
but the code not working...
SqlConnection con = new SqlConnection("Data Source=parthi\\sqlexpress;Integrated Security=true;Initial Catalog=employee");
SqlCommand cmd = new SqlCommand("select count(id) from joinees where year(regdate) = year(getdate()) and month(regdate) = month(getdate()) and day(regdate) = day(getdate())", con);
int intcount = Convert.ToInt32(cmd.ExecuteNonQuery());
sqlstr = "INSERT INTO joinees([name], [email],[phoneno]) values ('" + txtName.Text.ToString() + "','" + txtEMAIL.Text.ToString() + "','" + txtPHONE.Text.ToString() + " ')";
Label1.Text = " Thank You For Booking";
Label1.ForeColor = System.Drawing.Color.Green;
Label1.ForeColor = System.Drawing.Color.Red;
Label1.Text = "BOOKINGS FILLED FOR THE DAY.. TRY TOMMORROW";
Label1.Visible = false;
txtName.Text = "";
txtEMAIL.Text = "";
txtPHONE.Text = "";
Posted Date: May 02, 2013 Points: 20
getdate() method gives you complete date mm/dd/yyyy. so datepart (dw, '5/11/7') as dayOfTheWeek,
datename (dw, '5/11/7') as NameOfDay
Posted Date: May 14, 2013 Points: 20
Yes, I agree with Dharmendra as datepart function will give you dayoftheweek, datename and Nameoftheday.
Posted Date: May 17, 2013 Points: 20
Thanks for your suggestion
Posted Date: May 18, 2013 Points: 20
I am also using option explicit in my code, but didn't know the difference between option explicit and option inter. Can anyone please explain.
Posted Date: July 10, 2013 Points: 20
Thanks for sharing information but given code is not working. some mistake in your code.
To post reply
Related Questions Related Questions
What is Code Access Security in .NET
protection in C#.NET source code
How to get business or working day in a month in c#
What is IDE and its Working
please check the code
need code in C#
Best ASP.NET Websites for Sample Code / Code Projects
Code to create setup file .net
SQL Server 2005 - Working with IDENTITY column
Latest Forum Questions From The Same Category
how to learn and Where can i Learn about ASP .Net
Slash(/) in Combobox
attaching the report in the web page
How do i get payment status in redirect page using bitpay?
Login with Facebook and Save details in database
Login with facebook account in my website
How to make a nested datalist control?
What class does Icon derive from?
What are the validation controls?
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend