Combobox not filling from dataset
All:
This is my first project using WPF and I have to say, its not going so well :mad::mad:
I am attempting to populate a combo box on the main window of my application however despite the dataset having data, the box remains empty. Please take a look and let me know what you think.
Code:
Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim cn_mysql As New MySqlConnection
cn_mysql.ConnectionString = "Server=;Database=;Uid=;Pwd=;"
Dim dsGetProcs As New DataSet
Dim sqlGetProcs As String = "select Name from mysql.proc where db='test';"
Dim daProcs As New MySqlDataAdapter(sqlGetProcs, cn_mysql)
daProcs.Fill(dsGetProcs)
daProcs.Dispose()
cn_mysql.Close()
cmboRoutine.DataContext = dsGetProcs.Tables(0).DefaultView
cmboRoutine.DisplayMemberPath = "Name"
cmboRoutine.SelectedValuePath = "Name"
End Sub
Re: Combobox not filling from dataset
Shouldn't you use the itemsource in stead of datacontext.
?