Hello VB.net world,
Can someone please explain why none of the attempts below work?
Consider two tables, table1 and table2 in which table2 being the child of table1. The Foreign key relation is over field one of both tables. The relation is set to cascade upon update.
Textbox1 is bound to bindsource1, table1, field1. Textbox2 is bound to FKTable2Table1bindingsource, field2.
Upon update the, the new item is not included in table 2. The changes are observed in the dataset, but not transferred to the original database. The code:
BindingSource1.EndEdit()
changes = Table1TableAdapter.Update(Me.NewDataSet1)
Further, attempts to update table2 throw an exception.
BindingSource1.EndEdit()
changes = Table1TableAdapter.Update_(Me.NewDataSet1.Table1)
FKTable2Table1BindingSource.EndEdit()
Table2TableAdapter.Update(NewDataSet1.Table2)
Attempts to update the specific row also throw an exception.
BindingSource1.EndEdit()
changes = Table1TableAdapter.Update_(Me.NewDataSet1.Table1)
FKTable2Table1BindingSource.EndEdit()
Table2TableAdapter.Update(NewDataSet1.Table2.Rows(1))
Thanks,
Nu_B
Can someone please explain why none of the attempts below work?
Consider two tables, table1 and table2 in which table2 being the child of table1. The Foreign key relation is over field one of both tables. The relation is set to cascade upon update.
Textbox1 is bound to bindsource1, table1, field1. Textbox2 is bound to FKTable2Table1bindingsource, field2.
Upon update the, the new item is not included in table 2. The changes are observed in the dataset, but not transferred to the original database. The code:
BindingSource1.EndEdit()
changes = Table1TableAdapter.Update(Me.NewDataSet1)
Further, attempts to update table2 throw an exception.
BindingSource1.EndEdit()
changes = Table1TableAdapter.Update_(Me.NewDataSet1.Table1)
FKTable2Table1BindingSource.EndEdit()
Table2TableAdapter.Update(NewDataSet1.Table2)
Attempts to update the specific row also throw an exception.
BindingSource1.EndEdit()
changes = Table1TableAdapter.Update_(Me.NewDataSet1.Table1)
FKTable2Table1BindingSource.EndEdit()
Table2TableAdapter.Update(NewDataSet1.Table2.Rows(1))
Thanks,
Nu_B