Click here to Skip to main content
15,904,638 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

I have one scenario,

i have designed one page in asp.net, slot.aspx

where i have one textbox for SlotName and in one table i have no.of slots, ie.,
HTML
<table>
<tr><tdcolspan="3">Slot Name</td></tr>
<tr>
<td><input type="text" id="startime"/></td>
<td><input type="time" id="endime"/></td>
<td><input type="button" id='remove' value='remove' /> </td>
</tr>
<tr>
<td><input type="time" id="startime"/></td>
<td><input type="time" id="endime"/></td>
<td><input type="button" id='remove' value='remove' /> </td>
</tr>
<tr>
<td><input type="time" id="startime"/></td>
<td><input type="time" id="endime"/></td>
<td><input type="button" id='remove' value='remove' /> </td>
</tr>
<tr>
<td><input type="time" id="startime"/></td>
<td><input type="time" id="endime"/></td>
<td><input type="button" id='remove' value='remove' /> </td>
</tr>
</table>


What I have tried:

I want to store this data, in the sql table.

should i stored same name for each row or how.

can any one plz help me, what should be the structure of the table for this.


Thanks
Posted
Updated 28-Aug-16 12:52pm
v2
Comments
Maciej Los 28-Aug-16 12:07pm    
Well... You have to store these data in 2 columns (starttime, endtime). Each record have to be single row. So, i do not understand what kind of conusion you have...

1 solution

In order to take care of possible duplicate values of the slot name (and possibly the others) you should have an IDENTITY column. How this is implemented is a bit database specific, but it will assign, automatically, a unique value to each row in your table. You can then operate on that specific record by using the identity number in your where clause. You may wish to put constraints on your table, as well, such as forbidding two items from having the same slot, start, and end, or whatever else you wish to forbid so that entering it in the database will fail.

There's a lot of stuff you can do when creating your table to make your work not only much easier and keep your data less likely to be ruined by accident.
 
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