How do i set a limit for user to sign up in ASP.NET ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ivyG
    New Member
    • Nov 2010
    • 3

    #1

    How do i set a limit for user to sign up in ASP.NET ??

    How do i set a limit for user to sign up in ASP.NET ??

    For example, I'm creating a web application using Microsoft Visual Studio 2008 to make it available for users to sign up for the event.
    But i only wish to allow 10 people to sign up for that particular event.

    So what code/thing i need to do to able to set the limit??


    For your info : user only need to click one button to sign up for the event.
    Last edited by Frinavale; Nov 24 '10, 04:05 PM. Reason: Added the question into the thread so that it makes sense.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You are using a database or something right now to allow people to sign up for an event.

    You probably have a table for the "Event" details (with columns like date, time, location etc.) In that table add an integer field/column called "numberOfAttend ees" so that you can track the number of people attending the event. Whenever someone signs up for the event you can increment that value. If the maximum number of attendees (which you can also store as an integer field/column in your Event table if you want) is reached, then do not allow any more people to sign up for the event.

    You do not have to add the "numberOfAttend ees" column to your Events table if you don't want to. If you don't have this column, then you will have to query the table that contains the user-event-registration information and retrieve the COUNT value for the number of users signed up for the particular event in question.

    The second approach is better from a Normalization standpoint, but since I have no idea how you have structured your database, I can't help you any further.

    -Frinny

    Comment

    Working...