|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Listbox idiotic exampledb 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 Show quoteHide quote "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? > > > > > > > > > > "Kerry Moorman" <KerryMoor***@discussions.microsoft.com> wrote in message Thanks, that did it. Why should you have to do this, though?> > Try assigning a column name from the table to the listbox's DisplayMember > property. For example: > > lbTable.DisplayMember = "TableName" > 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.
Show Modal, then Again
Get associated icon for a file A question about finding class methods in the Help TopMost without SetFocus WEBREQUEST AND WEBRESPONSE PROBLEM Assigning a Value to a Structure Pointed to by a Tag ? VB.NET profiler progress bar right to left Importing XML File into an Empty Access Table Process output redirection? |
|||||||||||||||||||||||