-
1 Attachment(s)
dataview problem
In my VB.NET Project I have this code;
Dim dv As DataView
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OleDbDataAdapter1.Fill(DataSet11, "students")
dv = DataSet11.Tables("students").DefaultView
DataGrid1.DataSource = dv
'to combo
ComboBox1.DataSource = dv
ComboBox1.DisplayMember = "Students"
'But I encounter a problem.
'The combobox lists all like this "System.Data.DataRowView"
What should I do?
Using dv as DataView, I dont know what code should I write to go to next or previous record?
Kindly help me.. pls check the file I attached with this thread.
-
Hi,
What you want to display in the combobox ?
-
Try puting in .ValueMember = "Students" after the .DisplayMember line and see if that works.
I don't see what is wrong with that above apart from the .ValueMember is missing.
-
Hi,
As i notice, you are trying to fill the combobox with the column "students" that is not exist in your database. You cannot put the whole table into the conbobox without more wrok to be done.
:)