Filling a list box

  • Thread starter Thread starter Bryan Dickerson
  • Start date Start date
B

Bryan Dickerson

I'm trying to fill a listbox...

------------------------------
Dim oC As New localhost.Service1
Dim oSR As System.IO.StringReader

oSR = New
System.IO.StringReader(oC.GetAllContacts(oELookup.CustomerNum,
oELookup.CustomerType))
oDS.ReadXml(oSR)
lbContacts.DataSource = oDS.Tables("Table").Rows
lbContacts.DisplayMember =
oDS.Tables("Table").Columns("CI_NAME").ToString
lbContacts.ValueMember = oDS.Tables("Table").Columns("ID").ToString
 
Hi Bryan ! :O)

Try this :
lbContacts.DataSource = oDS.Tables("Table")

Now this is quite a detour ! :O)
lbContacts.DisplayMember =
oDS.Tables("Table").Columns("CI_NAME").ToString
lbContacts.ValueMember = oDS.Tables("Table").Columns("ID").ToString

How about this ?
'***
lbContacts.DisplayMember = "CI_NAME"
lbContacts.ValueMember = "ID"
'***
 
I did what you suggested and I finally got an error message:
"Could not bind to the new value member.
Parameter name: value"

Any clues as to what this means?
 
Hello?? Anyone there??

Bryan Dickerson said:
I did what you suggested and I finally got an error message:
"Could not bind to the new value member.
Parameter name: value"

Any clues as to what this means?
 
The newsgroup you have reached is no longer in service. Please check your address and try again.
 
I did what you suggested and I finally got an error message:
You can always google on that.. it's seems to happen in some specifics
occasions.

Can you show us a sample of the XML you load into the DataSet ? The problem
might be there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top