jgoodman00
Programmer
- Jan 23, 2001
- 1,510
I am trying to fill a listbox with data from a SQL Server database.
I am using the Northwind database, & attempting to display orders in a datagrid, based on selecting a customer from a listbox.
I dragged the orders & customers tables from server explorer, to create a dataconnection (dcNorthwind), two dataadapters (daOrders & daCustomers), & generated the dataset (dsNorthwind1). I then created a dataview dvCustomers.
If I preview the data it is visible.
I then set the:
In the page_load event I fill daCustomers. The page loads fine, but nothing is displayed in the listbox.
If I:
I get 91 records, which is correct.
Any suggestions as to where it is going wrong?
James Goodman MCSE, MCDBA
I am using the Northwind database, & attempting to display orders in a datagrid, based on selecting a customer from a listbox.
I dragged the orders & customers tables from server explorer, to create a dataconnection (dcNorthwind), two dataadapters (daOrders & daCustomers), & generated the dataset (dsNorthwind1). I then created a dataview dvCustomers.
If I preview the data it is visible.
I then set the:
Code:
dvCustomers.Table = dsNorthwind1.Customers
DataSource = dvCustomers
DataTextField = CompanyName
DataValueField = CustomerID
In the page_load event I fill daCustomers. The page loads fine, but nothing is displayed in the listbox.
If I:
Code:
Response.Write dvCustomers.Table.Rows.Count.ToString
I get 91 records, which is correct.
Any suggestions as to where it is going wrong?
James Goodman MCSE, MCDBA