Is it possible to bind two different tables to a listbox, or do I have to iterate through the result using the datareader and manually add each item in the listbox?
It may be possible to use a UNION sql query to get results from two tables
in a single sql statement. You can also fill datasets and arrays, to bind
to the listbox as well. But if the union query doesn't work, it probably is
easiest to just use a datareader.
--Michael
axlchris said:
Is it possible to bind two different tables to a listbox, or do I have to
if both tables have common fields to tie the DDL to then just use a JOIN
statement in your SQL (or would it be a UNION in this case?) either way, if
you can get one SQL statement to get your result you should be able to.
They have only one common field, but I can't use it to tie them together.
If I do, the result I want inside the listbox is in two different rows and I get a much bigger result than what I want.
Guess I'll use the reader to add the items manually then.
but thanks!
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.