Click here to Skip to main content
14,450,692 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi to all,

This project about hostel room allocation.In that room types are single seater (one person only),two seater (two persons only),Four seater(Four persons only), six seater(six person only) to stay. So now single seater booking is working fine. But i dont know how to insert second record (rollnumber) for same room(RoomNumber) in twoseater,four and six seater fields.

I need to insert records like below given table.

RollNumber RoomNumber RoomType Status
-------------------------------------------------------------
A101 1 Single Booked
-------------------------------------------------------------
A102 2 Single Booked
-------------------------------------------------------------
A103,A104 3 TwoSeater Booked
-------------------------------------------------------------
A105 4 TwoSeater Available
-------------------------------------------------------------
A106,A107,A108,A109 3 FourSeater Available
-------------------------------------------------------------
A105 4 FourSeater Available
-------------------------------------------------------------

asp.net3.5 using c#

Thanks in advance
Posted
Comments
OriginalGriff 21-Jun-12 6:54am
   
And what have you tried?
Or are you just going to ask us about each of the steps in you homework in sequence until we have done it for you?
Yes, I have seen your other question!
ssd_coolguy 21-Jun-12 6:55am
   
hey let us know...you are entering two people in same time or diff?
or you will update for second?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Hi,

I suggest you to not to insert multiple value into single row of same column.
because it create problem in future when you use this table.
You can insert like following eg.

insert into tablename values ('A103,A104',3,'TwoSeater',Booked)

I again suggest you to keep or insert record like this into your table.

RollNumber RoomNumber RoomType Status
-------------------------------------------------------------
A101 1 Single Booked
-------------------------------------------------------------
A102 2 Single Booked
-------------------------------------------------------------
A103 3 TwoSeater Booked
-------------------------------------------------------------
A104 3 TwoSeater Booked
-------------------------------------------------------------
A105 4 TwoSeater Available
-------------------------------------------------------------
A106 3 FourSeater Available
-------------------------------------------------------------
A107 4 FourSeater Available
-------------------------------------------------------------

This one easy and helpful way.

Ranjeet waje

   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100