我在组合框中出现错误,而不是组合框显示数据库...它在里面显示 combobox.text = "System.Data.DataRowView"。
Private Sub FillCombo()
Try
conn = New OleDbConnection(Get_Constring)
Dim sSQL As String = ("SELECT subject FROM student order by subject")
Dim da As New OleDbDataAdapter(sSQL, conn)
Dim ds As New DataSet
da.Fill(ds)
cmbsection.ValueMember = "ItemName"
cmbsection.DataSource = ds.Tables(0)
cmbsection.SelectedIndex = 0
Catch ex As Exception
MsgBox("ERROR : " & ex.Message.ToString)
End Try
结束子