Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop down box Data binding

Status
Not open for further replies.

bertrandkis

Programmer
Jul 26, 2002
101
0
0
ZA
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top