I have a form which has a combobox loading some data from database in the form load and i try to close the form it does not end
this is the code that fill the combobox
I'm using vs 2005 and thank you
this is the code that fill the combobox
Code:
Using conn As New System.Data.OleDb.OleDbConnection(ConnectionString)
conn.Open()
Dim sqlCmd As New System.Data.OleDb.OleDbCommand("select * from familles ", conn)
Dim dr As System.Data.OleDb.OleDbDataReader = sqlCmd.ExecuteReader()
dtProducts.Load(dr)
conn.Close()
End Using
combobox.DataBindings.Add(New System.Windows.Forms.Binding("Text", dtProducts, "ID", True, DataSourceUpdateMode.OnPropertyChanged))
combobox.DisplayMember = "famillenom"
combobox.DataSource = dtProducts