I'm using strong typed dataset.
The problem ties with datarelation string "BGHuntedBGHarvest." The "KillNo" is one data field in detail datatable. If I remove the binding, the error will show next data field. The error will be gone until I remove all data fields that not in the datarelation columns. Thanks. Ben
This is error message:
************************************************** **************************
BGHarvestBindingSource.DataMember = "BGHuntedBGHarvest"
Cannot bind to the property or column KillNo on the DataSource.
Parameter name: dataMember
************************************************** **************************
Here is the code:
- Public Class Form1
-
-
Private Sub BGHuntedBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BGHuntedBindingNavigatorSaveItem.Click
-
Me.Validate()
-
Me.BGHuntedBindingSource.EndEdit()
-
Me.BGHuntedTableAdapter.Update(Me.WL_TECHDataSet.BGHunted)
-
-
End Sub
-
-
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
'TODO: This line of code loads data into the '_WL_TECHDataSet.BGHarvest' table. You can move, or remove it, as needed.
-
Me.BGHarvestTableAdapter.Fill(Me._WL_TECHDataSet.BGHarvest)
-
'TODO: This line of code loads data into the '_WL_TECHDataSet.BGHunted' table. You can move, or remove it, as needed.
-
Me.BGHuntedTableAdapter.Fill(Me._WL_TECHDataSet.BGHunted)
-
Dim MasterColumn() As DataColumn
-
Dim DetailColumn() As DataColumn
-
MasterColumn = New DataColumn() {_WL_TECHDataSet.BGHunted.Columns("HuntingSeason"), _
-
Me._WL_TECHDataSet.BGHunted.Columns("SeqNo"), _
-
Me._WL_TECHDataSet.BGHunted.Columns("ShortName"), _
-
Me._WL_TECHDataSet.BGHunted.Columns("CountyCode")}
-
-
DetailColumn = New DataColumn() {Me._WL_TECHDataSet.BGHarvest.Columns("HuntingSeason"), _
-
Me._WL_TECHDataSet.BGHarvest.Columns("SeqNo"), _
-
Me._WL_TECHDataSet.BGHarvest.Columns("ShortName"), _
-
Me._WL_TECHDataSet.BGHarvest.Columns("CountyCode")}
-
-
-
'Me.Big_Game_Harvest_SurveyDataSet.Relations.Clear()
-
Dim relation As New DataRelation("BGHuntedBGHarvest", MasterColumn, DetailColumn, False)
-
Me._WL_TECHDataSet.Relations.Add(relation)
-
BGHuntedBindingSource.DataSource = Me._WL_TECHDataSet.BGHunted
-
BGHarvestBindingSource.DataSource = BGHuntedBindingSource
-
BGHarvestBindingSource.DataMember = "BGHuntedBGHarvest"
-
-
End Sub
-
End Class
{email address removed}