Salman  Mushtaq

Salman Mushtaq

  • NA
  • 45
  • 32.4k

What is actually use of Dataset

Dec 14 2013 1:10 PM
What is the actual benifet that we get from Dataset in c#.
I write many programs and understan it that dataset is use for creating relations between tables. But whenever i get ParentRow like

DataRow r = ParentTable.Row[0]; // Get first row in Parent table

Then i try to get ChildRow against the Primary key 

Like

DataRow[] cr = r.GetChildRows("RelationName");

And finally use foreach loop for print ChildRow Attributes but it cannot work , i try many time 
that is why i am confused and ask this question is this is not allowed or is it please provide me some code so i understand the concept and syntax.

I have two tables
1- Parent(Id,Name,Cgpa)
2 - Child(Cid,Address,Fid)  // Fid is foreign key

I know the primary key and want to get Record against that primary key in Child Table.


Answers (2)