Hi, I am making a project to see al my dvd's plus their information in a windows form with ado.net.
Now I've made a form that has the design like the picture "design.jpg". On this picture you can also see the datasources and tables I use.
The structure of my dataset is like on this picture: "dataset.jpg"
This is my code:
code Code:
Public Class frmDVDcollectie Private Sub frmDVDcollectie_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DtsMuziekcollectie.tblCategorieen' table. You can move, or remove it, as needed. Me.objTblCategorieenTableAdapter.Fill(Me.objDtsMuziekcollectie.tblCategorieen) 'TODO: This line of code loads data into the 'DtsMuziekcollectie.tblDVDInhoud' table. You can move, or remove it, as needed. Me.objTblDVDInhoudTableAdapter.Fill(Me.objDtsMuziekcollectie.tblDVDInhoud) Vullen() End Sub Private Sub Vullen() Dim dtvDVDInhoud As DataView dtvDVDInhoud = objDtsMuziekcollectie.tblDVDInhoud.DefaultView dtvDVDInhoud.RowFilter = "CategorieID = " & cboCategorie.SelectedValue.ToString dtvDVDInhoud.Sort = "DvdID ASC" objTblDVDInhoudBindingSource.DataSource = dtvDVDInhoud Me.objTblDVDInhoudBindingSource.MoveFirst() End Sub Private Sub cboCategorie_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboCategorie.SelectedIndexChanged If Not cboCategorie.SelectedValue Is Nothing Then Vullen() End If End Sub Private Sub btnVorige_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVorige.Click Me.objTblDVDInhoudBindingSource.MovePrevious() End Sub Private Sub btnVolgende_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVolgende.Click Me.objTblDVDInhoudBindingSource.MoveNext() End Sub Private Sub btnEerste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEerste.Click Me.objTblDVDInhoudBindingSource.MoveFirst() End Sub Private Sub btnLaatste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLaatste.Click Me.objTblDVDInhoudBindingSource.MoveLast() End Sub End Class
The problem I have is that when I compile the project that I can perfectly change the categoriebut when I have changed the categorie, the I've selected is there twice and the categorie that is one step above the one I've selected is gone. How can I make sure that all my categories keep standing their on there place?
Greetings
Hash




Reply With Quote