Show database information in listbox using SELECT query
-
Hello, I want to show database information in a listbox using a SELECT query. Something like: lstGeselecteerdeagenten.Items.AddRange(daGroepAgent.SelectCommand(SELECT * FROM daGroepAgent)) ??????????
You're going to have to seperate this. At least until the new version of VB.NET comes out. Create a method that queries the database for the fields you want in the ListBox and returns it in DataTable. Then bind the ListBox to the DataTable and your done. There's no reason to use the Items.Add method.
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
You're going to have to seperate this. At least until the new version of VB.NET comes out. Create a method that queries the database for the fields you want in the ListBox and returns it in DataTable. Then bind the ListBox to the DataTable and your done. There's no reason to use the Items.Add method.
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007