I'm starting a project using a Data Access Layer. I'm trying to bind a drop down list to a stored procedure that is implemented as follows:
haa_get_CategoriesTableAdapter <-- the defined table adapter
GetCateorgiesData() <-- the specified fill method using the stored proc
In the data design portion of VS2005, I can successfully return the dataset.
My problem is that I can not successfully bind to a drop down list. It's the syntax that I can't decipher. Here's the code that I currently have:
Partial Class Default2
Protected Sub page_load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim categoryAdapter As New haa_get_CategoriesTableAdapter
CategoryListBox.DataSource = categoryAdapter.GetCategoriesData
'CategoryListBox.DataTextField = categoryTable.
When I 'show in browser' with the above code, I get a drop down box filled with 'System.Data.DataRowView', one for each record in the table.
I think I know that I need to be able to define CategoryListBox.DataTextField but I can't find the correct syntax.
Has anyone done this? Would you share the code with me?