binding multiple sources to listbox

Discussion in 'ASP .Net' started by axlchris, Jan 20, 2004.

  1. axlchris

    axlchris Guest

    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?

    thanks

    ---
    Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
     
    axlchris, Jan 20, 2004
    #1
    1. Advertising

  2. axlchris

    Michael Guest

    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" <> wrote in message
    news:e6K$...
    > 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?
    >
    > thanks
    >
    > ---
    > Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

    Community Website: http://www.dotnetjunkies.com/newsgroups/
     
    Michael, Jan 20, 2004
    #2
    1. Advertising

  3. axlchris

    Curt_C [MVP] Guest

    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.

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "axlchris" <> wrote in message
    news:e6K$...
    > 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?
    >
    > thanks
    >
    > ---
    > Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

    Community Website: http://www.dotnetjunkies.com/newsgroups/
     
    Curt_C [MVP], Jan 20, 2004
    #3
  4. axlchris

    axlchris Guest

    re: Re: binding multiple sources to listbox

    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!

    ---
    Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
     
    axlchris, Jan 21, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hamed
    Replies:
    3
    Views:
    3,372
    Richard Grimes [MVP]
    Feb 15, 2004
  2. Salman Sheikh

    Address muxing from multiple sources

    Salman Sheikh, Aug 28, 2003, in forum: VHDL
    Replies:
    0
    Views:
    603
    Salman Sheikh
    Aug 28, 2003
  3. Henk De Denktenk
    Replies:
    6
    Views:
    695
  4. K B
    Replies:
    2
    Views:
    699
  5. et

    Binding a grid to various sources.

    et, Apr 14, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    138
Loading...

Share This Page