bertrandkis
Programmer
Hello friends,
I am trying to bind a dataset to a drop down box
using the following code:
strSQL= "SELECT RoleID ,FullName FROM CONTACT "
Dim dsDataset As New DataSet
Dim daAdapter As New SqlClient.SqlDataAdapter(strSQL, dbConnection)
daAdapter.Fill(dsDataset)
With cboContacts
.DataSource = dsDataset.Tables(0)
.DisplayMember = "Fullname"
.ValueMember = "RoleID"
End
I am getting the following error:
Syntax error converting the Varchar value 'System.Data.DataRowView' to a column of datatype int
When I step through the code the error is occuring at this line: .DisplayMember = "Fullname".
I am using .net Framework 1.1
and I have also made sure that the dataset is not empty.
Can I have some help please!
I am trying to bind a dataset to a drop down box
using the following code:
strSQL= "SELECT RoleID ,FullName FROM CONTACT "
Dim dsDataset As New DataSet
Dim daAdapter As New SqlClient.SqlDataAdapter(strSQL, dbConnection)
daAdapter.Fill(dsDataset)
With cboContacts
.DataSource = dsDataset.Tables(0)
.DisplayMember = "Fullname"
.ValueMember = "RoleID"
End
I am getting the following error:
Syntax error converting the Varchar value 'System.Data.DataRowView' to a column of datatype int
When I step through the code the error is occuring at this line: .DisplayMember = "Fullname".
I am using .net Framework 1.1
and I have also made sure that the dataset is not empty.
Can I have some help please!