HI foks, (this is my first post)
(I am getting really tired of this problem
I have a form with a master/detail on it, wich shows the mastertable
and the childtables, the tables are related to eachother correctly.
The strange thing is, that navigating through the master/detail is going very well,
only updating a CHILDTABLE is going very bad.
The textbox in wich text is changed, doesn't 'tell' the dataset, that something has changed.....
1)The datablechanges has 1 row, that is, when there is a modification or a add in a table of the dataset.
2) the update/delete/insert commands are initialised during the load_form vent,
here is a small one:
Code:
Private Sub InitializeFunctieGezochtAdapter()
'
'SqlDataAdapter5
'
Dim SqlSelectCommand5 As New System.Data.SqlClient.SqlCommand
Dim SqlInsertCommand5 As New System.Data.SqlClient.SqlCommand
Dim SqlUpdateCommand5 As New System.Data.SqlClient.SqlCommand
Dim SqlDeleteCommand5 As New System.Data.SqlClient.SqlCommand
'
'SqlSelectCommand5
'
SqlSelectCommand5.CommandText = "SELECT id_persoon, id_functiegezocht, functiegezocht FROM tblFunctieGezocht"
SqlSelectCommand5.Connection = objconn
'
'SqlInsertCommand5
'
.......................................
'
'SqlUpdateCommand5
'
...................................... '
'SqlDeleteCommand5
'
........................................
mdaDataAdapterFunctieGezocht = New SqlDataAdapter
mdaDataAdapterFunctieGezocht.DeleteCommand = SqlDeleteCommand5
mdaDataAdapterFunctieGezocht.InsertCommand = SqlInsertCommand5
mdaDataAdapterFunctieGezocht.SelectCommand = SqlSelectCommand5
mdaDataAdapterFunctieGezocht.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "tblFunctieGezocht", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("id_persoon", "id_persoon"), New System.Data.Common.DataColumnMapping("id_functiegezocht", "id_functiegezocht"), New System.Data.Common.DataColumnMapping("functiegezocht", "functiegezocht")})})
mdaDataAdapterFunctieGezocht.UpdateCommand = SqlUpdateCommand5
End Sub
( I shortened it of course)
I use buttons to navigate through the master/detail, example: the next button has the following code:
Code: Me.BindingContext(nwDatasetInstance, "tblpersoon").Position = (Me.BindingContext(nwDatasetInstance, "tblpersoon").Position + 1)
*******************************************************************************************
I used the bindingcontext of a form to synchronize the master/detail tables in a dataset,
ain't there another way of synchronizing, without this terrible bindingcontext?
Anyway, great that you reacted,
Regards,
Reinier
(I am getting really tired of this problem
I have a form with a master/detail on it, wich shows the mastertable
and the childtables, the tables are related to eachother correctly.
The strange thing is, that navigating through the master/detail is going very well,
only updating a CHILDTABLE is going very bad.
The textbox in wich text is changed, doesn't 'tell' the dataset, that something has changed.....
1)The datablechanges has 1 row, that is, when there is a modification or a add in a table of the dataset.
2) the update/delete/insert commands are initialised during the load_form vent,
here is a small one:
Code:
Private Sub InitializeFunctieGezochtAdapter()
'
'SqlDataAdapter5
'
Dim SqlSelectCommand5 As New System.Data.SqlClient.SqlCommand
Dim SqlInsertCommand5 As New System.Data.SqlClient.SqlCommand
Dim SqlUpdateCommand5 As New System.Data.SqlClient.SqlCommand
Dim SqlDeleteCommand5 As New System.Data.SqlClient.SqlCommand
'
'SqlSelectCommand5
'
SqlSelectCommand5.CommandText = "SELECT id_persoon, id_functiegezocht, functiegezocht FROM tblFunctieGezocht"
SqlSelectCommand5.Connection = objconn
'
'SqlInsertCommand5
'
.......................................
'
'SqlUpdateCommand5
'
...................................... '
'SqlDeleteCommand5
'
........................................
mdaDataAdapterFunctieGezocht = New SqlDataAdapter
mdaDataAdapterFunctieGezocht.DeleteCommand = SqlDeleteCommand5
mdaDataAdapterFunctieGezocht.InsertCommand = SqlInsertCommand5
mdaDataAdapterFunctieGezocht.SelectCommand = SqlSelectCommand5
mdaDataAdapterFunctieGezocht.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "tblFunctieGezocht", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("id_persoon", "id_persoon"), New System.Data.Common.DataColumnMapping("id_functiegezocht", "id_functiegezocht"), New System.Data.Common.DataColumnMapping("functiegezocht", "functiegezocht")})})
mdaDataAdapterFunctieGezocht.UpdateCommand = SqlUpdateCommand5
End Sub
( I shortened it of course)
I use buttons to navigate through the master/detail, example: the next button has the following code:
Code: Me.BindingContext(nwDatasetInstance, "tblpersoon").Position = (Me.BindingContext(nwDatasetInstance, "tblpersoon").Position + 1)
*******************************************************************************************
I used the bindingcontext of a form to synchronize the master/detail tables in a dataset,
ain't there another way of synchronizing, without this terrible bindingcontext?
Anyway, great that you reacted,
Regards,
Reinier