A
Anil Gupte
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("SliceInfo")
Dim tblSliceRatings As New DataTable("SliceRatings")
'.... All the adding datacolumns, datarows, etc. goes here..
DatasetInit.Tables.Add(tblSliceInfo)
DatasetInit.Tables.Add(tblSliceRatings)
Dim colSliceInfo As DataColumn
Dim colSliceRatings As DataColumn
colSliceInfo = tblSliceInfo.Columns("SliceID")
colSliceRatings = tblSliceRatings.Columns("SliceRatingsID")
Dim SliceIDRelation As DataRelation
SliceIDRelation = New DataRelation("SliceIDRelation", colSliceInfo,
colSliceRatings)
DatasetInit.Relations.Add(SliceIDRelation)
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,
now put two tables created with a DataTable class into a DataRelation.
Phew! And it works!
Dim tblSliceInfo As New DataTable("SliceInfo")
Dim tblSliceRatings As New DataTable("SliceRatings")
'.... All the adding datacolumns, datarows, etc. goes here..
DatasetInit.Tables.Add(tblSliceInfo)
DatasetInit.Tables.Add(tblSliceRatings)
Dim colSliceInfo As DataColumn
Dim colSliceRatings As DataColumn
colSliceInfo = tblSliceInfo.Columns("SliceID")
colSliceRatings = tblSliceRatings.Columns("SliceRatingsID")
Dim SliceIDRelation As DataRelation
SliceIDRelation = New DataRelation("SliceIDRelation", colSliceInfo,
colSliceRatings)
DatasetInit.Relations.Add(SliceIDRelation)
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,