Example: class table
| ClassId | Cassname |
| 1 | 10th class |
student table
| classid | stuName | Address |
| 1 | xyz | hyd |
| 1 | abc | hyd |
| 1 | pqr | hyd |
Now my requirement is i want to show data following way in gridview
| classid | stName1 | Address1 | stuName2 | address2 | stuname3 | address3 | ||
| 1 | xyz | hyd | abc | hyd | pqr | hyd |
i am struggling with this from one week.
Help me.
Thanksinadvance
Jiteendra SampathiraoPosted Aug 9, 2011, 1:38 AM
Mamta MPosted Aug 4, 2011, 5:20 AM
http://msdn.microsoft.com/en-us/library/system.data.datarelation%28VS.80%29.aspx
If that is not a feasible solution for you then
Suggestion 2:
Programmatically create a temporary new table having the merged columns of both tables (hint: use SQL joins to do that) and then populate the gridview with that temporary table
To create the table use DataTable class
To merge the columns of the two tables use SQL joins