I am trying to (hand) code a dropdown list that gets populated from the DB with the following code:[tt]
Dim strConn As String = "server=richard;database=reports;uid=brownFox;password=lazyDog"
Dim conn As New SqlConnection(strConn)
Dim myCommand As New SqlDataAdapter("grant_selection_source_dd", strConn)
Dim mydad As New SqlDataAdapter()
mydad.SelectCommand = New SqlCommand("grant_selection_source_dd", conn)
mydad.SelectCommand.CommandType = CommandType.StoredProcedure
Dim ds As New DataSet()
mydad.Fill(ds)
grant_source_dd.DataSource = ds
grant_source_dd.databind()
[/tt]The problem is is that "databind()" is not a valid property for Windows Applications. I used this code in a Web App, but how do I do it for a Win App? When I run the above code (with the last line commented-out), the combobox reads "[tt]System.Data.DataViewManagerListItem[/tt]"
What is the right way to do this?
Thanks very much!
Lazer
Dim strConn As String = "server=richard;database=reports;uid=brownFox;password=lazyDog"
Dim conn As New SqlConnection(strConn)
Dim myCommand As New SqlDataAdapter("grant_selection_source_dd", strConn)
Dim mydad As New SqlDataAdapter()
mydad.SelectCommand = New SqlCommand("grant_selection_source_dd", conn)
mydad.SelectCommand.CommandType = CommandType.StoredProcedure
Dim ds As New DataSet()
mydad.Fill(ds)
grant_source_dd.DataSource = ds
grant_source_dd.databind()
[/tt]The problem is is that "databind()" is not a valid property for Windows Applications. I used this code in a Web App, but how do I do it for a Win App? When I run the above code (with the last line commented-out), the combobox reads "[tt]System.Data.DataViewManagerListItem[/tt]"
What is the right way to do this?
Thanks very much!
Lazer