|
-
Feb 22nd, 2003, 12:01 PM
#1
Thread Starter
Lively Member
DataRelation & Binding Not Working!!
I have created a one to one relation between parent “member” table and a child “Measurements” table, the relation works fine.
The problem is, the child table displayed in a DataGrid in the upper area of the form, & the bottom area I have some textbox which the data in the DataGrid binded to it, meaning when the user clicks on any row in the DataGrid, details should appear in this textboxs, but this is not happening !!!
I wonder if I have a coding error, next is the code used:
myDA.Fill(myDS, "Member")
myMeasureDA.Fill(myDS, "Measure")
‘ Add DataRelation the DataSet
myDS.Relations.Add("MemMsr", myDS.Tables("Member").Columns("MemberID"), myDS.Tables("Measure").Columns("MemberID"))
' cbSelect Member DataSource
Me.cbSelect.DataSource = myDS.Tables("Member")
Me.cbSelect.DisplayMember = "MemberID"
‘ Bind data in the first window form
Me.txtMemberName_e.DataBindings.Add("Text", myDS.Tables("Member"), "Name_e")
Me.dgMeasurements.DataSource = myDS.Tables("Measure")
‘ the next line is spoiling my next databinding
Me.dgMeasurements.SetDataBinding(myDS, "Member.MemMsr")
‘ bind the 2nd window form (*** this binding get spoiled ***)
Me.txtWeight.DataBindings.Add("Text", myDS.Tables("Measure"), "Weight")
Me.txtHeight.DataBindings.Add("Text", myDS.Tables("Measure"), "Height")
Any idea where is the problem?
Thanks for the help
<><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|