After reading a tutorial and fiddling, I finally got this to work. I can
now put two tables created with a DataTable class into a DataRelation.
Phew! And it works!
Dim tblSliceInfo As New DataTable("Slic eInfo")
Dim tblSliceRatings As New DataTable("Slic eRatings")
'.... All the adding datacolumns, datarows, etc. goes here..
DatasetInit.Tab les.Add(tblSlic eInfo)
DatasetInit.Tab les.Add(tblSlic eRatings)
Dim colSliceInfo As DataColumn
Dim colSliceRatings As DataColumn
colSliceInfo = tblSliceInfo.Co lumns("SliceID" )
colSliceRatings = tblSliceRatings .Columns("Slice RatingsID")
Dim SliceIDRelation As DataRelation
SliceIDRelation = New DataRelation("S liceIDRelation" , colSliceInfo,
colSliceRatings )
DatasetInit.Rel ations.Add(Slic eIDRelation)
Anyway, what I want to do now is that instead of using those tables as
above, I want to use a SQL statement so that I can select the correct
records from the child table. How do I do this? I am planning to bind the
values in the fields to textboxes and then allow editing of those.
Please give me a clue how to go about it.
Thanx,
--
Anil Gupte
www.icinema.com
now put two tables created with a DataTable class into a DataRelation.
Phew! And it works!
Dim tblSliceInfo As New DataTable("Slic eInfo")
Dim tblSliceRatings As New DataTable("Slic eRatings")
'.... All the adding datacolumns, datarows, etc. goes here..
DatasetInit.Tab les.Add(tblSlic eInfo)
DatasetInit.Tab les.Add(tblSlic eRatings)
Dim colSliceInfo As DataColumn
Dim colSliceRatings As DataColumn
colSliceInfo = tblSliceInfo.Co lumns("SliceID" )
colSliceRatings = tblSliceRatings .Columns("Slice RatingsID")
Dim SliceIDRelation As DataRelation
SliceIDRelation = New DataRelation("S liceIDRelation" , colSliceInfo,
colSliceRatings )
DatasetInit.Rel ations.Add(Slic eIDRelation)
Anyway, what I want to do now is that instead of using those tables as
above, I want to use a SQL statement so that I can select the correct
records from the child table. How do I do this? I am planning to bind the
values in the fields to textboxes and then allow editing of those.
Please give me a clue how to go about it.
Thanx,
--
Anil Gupte
www.icinema.com
Comment