Listbox idiotic example

  • Thread starter Thread starter Peter Lux
  • Start date Start date
P

Peter Lux

Ok.. all I'm trying to do is get a list of non-system tables from a Sqlbase
db into a listbox. The following returns many rows that say:
System.Data.DataRowView
System.Data.DataRowView
..
..
..
Here's the code:

hQuest.ConnectionString = "DSN=this worksfine.."

hQuest.Open()

sSelect = "select name from sysadm.systables where name not like 'SYS%' "

Dim Cmd As New Odbc.OdbcCommand(sSelect, hQuest)

da.SelectCommand = Cmd

Dim ds As DataSet = New DataSet

da.Fill(ds)

lbTable.DataSource = ds.Tables(0)

hQuest.Close()

What's wrong? Is it the data adapter or the data set?
 
Peter,

Try assigning a column name from the table to the listbox's DisplayMember
property. For example:

lbTable.DisplayMember = "TableName"

Kerry Moorman
 
Kerry Moorman said:
Try assigning a column name from the table to the listbox's DisplayMember
property. For example:

lbTable.DisplayMember = "TableName"

Thanks, that did it. Why should you have to do this, though?
 
Hi

I think that would tell which property of the listbox to bind for the
datasource.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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