Click here to Skip to main content
15,912,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.

SQL
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

 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900