Click here to Skip to main content
Sign Up to vote bad
good
See more: SQL2005C#
I am making a event management system....
I want only 3 events can be booked per day not more than 3
I do not know how to do this
any help will be appreciated
Posted 23 Nov '12 - 3:02
Edited 23 Nov '12 - 3:03

Comments
Krunal R - 23 Nov '12 - 9:06
string str=""; foreach(DataRow dr in dataTable.Rows) { if(dr.count>3) { str = "Enough Records are there for today.."; } } return str;

1 solution

Before you insert a new record, run a query against your table where you store the events and count how many already exist. If there are already 3, then simply don't allow a user to continue adding new records.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 611
1 Maciej Los 265
2 Slacker007 240
3 CPallini 235
4 OriginalGriff 210
0 Sergey Alexandrovich Kryukov 9,118
1 OriginalGriff 7,134
2 CPallini 3,803
3 Rohan Leuva 3,135
4 Maciej Los 2,558


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid