Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Database
Database General Discussion
updateproblem in master/detail tables
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="reinier, post: 3852, member: 1627"] 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: [size=2][b]Code:[/b] [/size] 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: [size=2][b]Code:[/b] [/size]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[img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img][img]http://www.vbcity.com/forums/smiles/sad.gif[/img] [/QUOTE]
Insert quotes…
Verification
Post reply
Database
Database General Discussion
updateproblem in master/detail tables
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom