Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parent/child relationship in .net form w/multiple datasets

Status
Not open for further replies.

brodie1227

Vendor
Feb 19, 2004
76
US
I have a form with two datasets. One dataset is for our 'Grades' table in an access database. The second dataset is for our 'gradesdetail' table in the same db. The form is bound to the first dataset. This same form has a datagrid which is bound to the second dataset.(I am trying to replicate an access subform)

My problem occurs when I scroll through records in the first dataset. I would like to have the datagrid return the values from the second dataset where the 'gradeid' matches the 'gradeid' in the first dataset

I have attempted to configure the data adapter for the second data set by going to query builder and setting the criteria for the 'gradeid' column to look at the 'gradeid' column from the first dataset.

I have also attempted to set the criteria to the value of the text box on the form which is bound to the 'gradeid' value from the first dataset.

Any suggestions are greatly welcomed. Thanks.
 
Maybe if I provide my sql statements I have tried, then maybe someone can help me with my syntax.

These are the three sql statements I have tried w/no result

SELECT GradeID, LabSpec, LabSpecResult, LabSpecResultMax FROM GradesDetail WHERE (GradeID = clng(textbox5.txt))

SELECT GradeID, LabSpec, LabSpecResult, LabSpecResultMax FROM GradesDetail WHERE (GradeID = (dsfrmgrades1.gradeid))

SELECT GradeID, LabSpec, LabSpecResult, LabSpecResultMax FROM GradesDetail WHERE (GradeID = (dsfrmgrades1.grades.gradeid))
 
The first place to start is to use only one dataset. Use two datatables in the one dataset, and create a datarelation object.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top