To display data of multiple tables
-
HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...
-
HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...
It's unclear... Do you want to display some unrelated data from several tables in one grid? I think it's impossible... If it is complementary data from different tables use JOIN in the SQL... If this is some hierarchical data you may see this article: http://msdn.microsoft.com/en-us/magazine/cc164077.aspx[^]
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V) תפסיק לספר לה' כמה הצרות שלך גדולות, תספר לצרות שלך כמה ה' גדול!
-
HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...
Create a stored procedure and get the data from multiple tables as per their relation in one result set and display them in grid view.
-
HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...
If these two tables are similar, you can use a UNION[^] clause. If they have a foreign key relationship, you could join[^] the two tables and then display them together. Or
DataRelation dr = new DataRelation("Relation", ds.SomeTable.Columns["code"], ds.OtherTable.Columns["pCode"]);
gView.DataSource = ds.SomeTable;