Populated ListBox

  • 15 years ago

    Hello I'm trying to populate a ListBox using a DataSet in VB .MET
    I have 3 TextBoxes (ID, LastName and FirstName) and a ListBox
    Using the DataSet method I can fill the new table with Id, last name and first name...
    but the LidtBox still empty...!

                  objDataAdapter.SelectCommand = New OleDb.OleDbCommand(MySQL, objConn)
                   'Fill the table (Cartes)
                   objDataAdapter.Fill(objDataSet, "Cards")
                   'Close the connection to the DataBase

                   'Binding the TextBoxes with Data
                   TextBoxNom.DataBindings.Add("Text", objDataSet, "Cartes.EmpNom")
                   TextBoxPrenom.DataBindings.Add("Text", objDataSet, "Cartes.Emp
                   ListBox.DataBindings.Add("Text", objDataSet, "Cartes.EmployésCartesNom")
                               exceptionObject As Exception
               End Try


Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I invented the term Object-Oriented, and I can tell you I did not have C++ in mind.” - Alan Kay