I am trying to populate a combobox from a dataset but I am getting the following error: System.NullReferenceException, object reference not set to an instance of an object.
here's my code, can't see where I failed to instantiate.
Dim dad = New OleDbDataAdapter
Dim ds As DataSet
Dim strConn, strSQL As String
strConn = "Data Source=Data3;Integrated Security=SSPI"
strSQL = "Select instNbr from MyTable"
dad = New SqlClient.SqlDataAdapter(strSQL, strConn)
ds = New DataSet
dad.Fill(ds)
cboInstNbr.DataSource = ds.Tables("MyTable")
cboInstNbr.DisplayMember = ds.Tables("MyTable").Columns("instNbr").ToString
the error occurs on the displaymember line of code.
Help a newbie with VB.Net.
Thanks!
