VB.NET - add record in different way - Asked By shravan modhavadiya on 07-Dec-12 07:45 AM

i have 3 column in my table  like   no,pname,serial
i want to add data like this      
no     pname     serial
1 abc 0111
0112
0113
2 def 0211
0215
0269
Jatin Prajapati replied to shravan modhavadiya on 10-Dec-12 08:20 AM
Hi Shravan,

For your query it seems that you want to add related data in database. For that you have to use Normalization.
See the below table structure.

1. tblPName
Columns: 1. Number (Autogenerated), 2. pname

2. tblSerial
Columns: 1. serial, 2. pnamenumber.


Here in the above structure. all your serial items are related to tblPName via the columns pnamenumber in tblSerial and Number in tblPName.

If you want to use single table then you have to save no. and pname for all the serial records which are related to the pname. And this is not the good database design.