Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Event Registration Form- ASP

I have a registration form to database design to take a register's name and guests information for an event and send it to a db. The event will consits of 60 seating tables with 10 people only to a table. How can I write a code that will allow an individual to select a table to register for seating with each table only can support 10 person.

The form to db is working great. I'm just stuck on how to control the number of personnels to registering when a table is full.

Comments

  • ZantosZantos Member Posts: 139
    Well if you have 6 tables make 6 arrays:
    [code]
    Dim table1(9) As [String]
    Dim table2(9) As [String]
    Dim table3(9) As [String]
    Dim table4(9) As [String]
    Dim table5(9) As [String]
    Dim table6(9) As [String]
    [/code]

    Now you have 6 tables (arrays) with 10 (arrays start at 0) available seats.
    Have a page load that loops through each array and check for any fields that contain no data (meaning the seat is available if no ones name is in that field). If there is atleast one field with no data then that table is not full and should be displayed (via a link or graphic that takes you to register for a seat in that table). If the table (array) has no fields that are empty then that table is already full.

    As for the backend, i will assume we have a database with 6 tables in it.
    [code]
    ex.
    '//declare your variables
    Dim table1(9) As [String] : Dim table2(9) As [String]
    Dim table3(9) As [String] : Dim table4(9) As [String]
    Dim table5(9) As [String] : Dim table6(9) As [String]
    Dim data As DataSet
    Dim dr As DataRow
    Dim i As Integer = 0

    '//open the database
    data = [i]your db code here[/i]

    '//loop through the database and add the names to the array
    '//fill in array for table 1
    For Each dr In data.Tables(0).Rows
    table1(i) = dr(0)
    i = i + 1
    Next
    i = 0

    '//fill in array for table 2
    For Each dr In data.Tables(1).Rows
    table2(i) = dr(0)
    i = i + 1
    Next
    i = 0

    '//so on...

    [/code]

    then somewhere you'd check the arrays for null values. A null value would mean the table still has room for more people.

    I hope this makes sense to you.
    [code]<%
    '// Programmed By: Zantos
    '// VisualProgramming.NET
    '// http://vp.funurl.com/
    '// visualprogramming@hotmail.com
    %>[/code]

Sign In or Register to comment.