|
-
Oct 5th, 2007, 09:26 AM
#1
Thread Starter
Hyperactive Member
Really new to VB
Hi,
This is just something simple that im sure you can all answer.
In access you can create a list box and set its Row Source to look up a query.
How is this done in VB.
Cheers
-
Oct 5th, 2007, 09:45 AM
#2
Re: Really new to VB
You can bind a list (any type of list, including a DataTable) to a ListBox via its DataSource property. Populating that DataTable from a database is a completely independent operation.
http://www.vbforums.com/showthread.php?t=469872
-
Oct 5th, 2007, 10:10 AM
#3
Thread Starter
Hyperactive Member
Re: Really new to VB
Thanks,
So you can bind a listbox to a query in your data source?
-
Oct 5th, 2007, 10:16 AM
#4
Re: Really new to VB
 Originally Posted by mrmojorisin
Thanks,
So you can bind a listbox to a query in your data source?
No. As I have already said, you can bind a ListBox to a DataTable that contains data. Populating that DataTable from a database using a query is a completely separate operation that I have exemplified in the thread I provided a link to.
The ListBox doesn't care where the data in the DataTable came from, or even if the list it's bound to is a DataTable. Data-binding and data access are two separate things that are often used together because displaying data from a database is often a desirable thing to do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|