473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Listbox idiotic example

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?



Jan 24 '06 #1
3 1014
Peter,

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

lbTable.DisplayMember = "TableName"

Kerry Moorman

"Peter Lux" wrote:
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?



Jan 24 '06 #2

"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message

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?
Jan 25 '06 #3
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.

Jan 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
8
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
0
by: | last post by:
Greets All, Question on data in datagrid /listbox and looping? I’m trying to decide the best way to write this code. 1 would like the user to make several selections from one listbox/combo box...
0
by: | last post by:
Greets All, Question on data in datagrid /listbox and looping? I’m trying to decide the best way to write this code. 1 would like the user to make several selections from one listbox/combo box...
2
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I...
0
by: LostInMd | last post by:
Hi All, I've got an owner drawn listBox where I draw and measure the items that I add to the listBox. For example, I have a listBox that can only display 10 characters on each horizontal line. ...
5
by: WRH | last post by:
Hello I want to have a multicolumn listbox. I never used one before so I looked at a Help example. I set the multicolumn property and the column width and tested with this example... ...
8
by: jh | last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a textbox but can't figure out how to accomplish this for a listbox. Any help? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.