Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi All,

I have a requirement, One parent table and three depended(child) tables. When i click on save button i need to insert those records into the respective tables as shown below, and bind those records to the Gridview. Bellow is the table structure

Table
Id,Name,Desc
Tablech1
id,fkid (parent),name
Tablech2
id,fkid (parent),name
Tablech3
id,fkid (parent),name

Insertion Data:
Table(parent)
1,Name, NameDesc

TableCh1
1,1,Name
2,1,Name1
3,1,name2

Table Ch2
1,1,Name
2,2,Name1
3,3,Name2

Table Ch3
1,1,name
2,1,name1
3,1,name2

i need records like as shown below
1,t1.name,tch1.name,tch2.name,tch3.name
---------------------------------------
1, name,name,name,name
2,name,name1,name1,name1
3,name,name2,name2,name2

how can i insert those records into the table and get those records
Please suggest me. Thanks in advance...
Posted
Comments
Sergey Alexandrovich Kryukov 24-Feb-13 21:00pm    
What did you try so far?
—SA
Tharaka MTR 25-Feb-13 0:29am    
yes, this is a one of easiest question. what did you try so far?
gvprabu 25-Feb-13 1:49am    
Hi,
In Parent table you have only 1 record (ID=1) then how you will get 3 rows like 1, 2, 3.
MalwareTrojan 25-Feb-13 2:10am    
In Front-end Which Controls you are using for respective of 3 Child Tables and Parent Table?

Are you making 2 Imaginary child tables for Table Ch1 as Table Ch2 and Table Ch3?

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