PC Review


Reply
Thread Tools Rate Thread

add more than one member to listbox

 
 
QT
Guest
Posts: n/a
 
      30th Aug 2003
Dear Sirs,

I am using following scripts to add data members to listbox, but I can only
add one fiels. Any idea how can I add more than one data fields to listbox?

Me.cmbGurup.DataSource = dv
Me.cmbGurup.DisplayMember = "Gurup"


 
Reply With Quote
 
 
 
 
Fergus Cooney
Guest
Posts: n/a
 
      30th Aug 2003
Hi QT,

How are you setting up dv ?

Regards,
Fergus


 
Reply With Quote
 
QT
Guest
Posts: n/a
 
      30th Aug 2003
Dear Sirs,

Like this

Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data Source=" &
VB6.GetPath & "\Rehber.mdb"

Dim sqlStr As String = "SELECT DISTINCT Gurup FROM Rehber Order by Gurup"

Dim conn As OleDbConnection = New OleDbConnection(conStr)

' Create data adapter object

Dim da As OleDbDataAdapter = New OleDbDataAdapter(sqlStr, conn)



' Create a dataset object and fill with data using data adapter's Fill
method

Dim ds As DataSet = New DataSet

da.Fill(ds, "Rehber")

' Attach dataset's DefaultView to the datagrid control

Dim dv As DataView = ds.Tables("Rehber").DefaultView



Me.cmbGurup.DataSource = dv

Me.cmbGurup.DisplayMember = "Gurup"



"Fergus Cooney" <filter-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi QT,
>
> How are you setting up dv ?
>
> Regards,
> Fergus
>
>



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      31st Aug 2003
QT
Do you know that in the listbox you can only use one column (which can be
presented horizontal).
I advise you to take a look at the listview
Cor


 
Reply With Quote
 
QT
Guest
Posts: n/a
 
      31st Aug 2003
thank you

"Cor" <(E-Mail Removed)> wrote in message
news:3f51acc2$0$29218$(E-Mail Removed)...
> QT
> Do you know that in the listbox you can only use one column (which can be
> presented horizontal).
> I advise you to take a look at the listview
> Cor
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox member name Matthew Microsoft VB .NET 3 6th Oct 2004 05:59 PM
Listbox member name Matthew Microsoft VB .NET 0 6th Oct 2004 04:58 PM
Re: add more than one member to listbox Jay B. Harlow [MVP - Outlook] Microsoft Dot NET 0 30th Aug 2003 10:31 PM
Re: add more than one member to listbox Frank Eller [MVP] Microsoft Dot NET 0 30th Aug 2003 09:59 PM
value member into listbox dennist Microsoft ADO .NET 10 10th Aug 2003 05:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:00 AM.