populate ddl from two tables

Discussion in 'ASP .Net' started by =?Utf-8?B?SklNLkgu?=, Jun 6, 2005.

  1. Hello,
    I have two Tables: Table1: GroupID1, GroupName1 and Table2:GroupID2,
    GroupName2.

    I have only one dropdown list (DropDownList1) in my application and through
    a stored procedure I want to populate my DropDownList1 from GroupName1 and
    GroupName2. How should I write my query?
    Thanks,
    Jim.
     
    =?Utf-8?B?SklNLkgu?=, Jun 6, 2005
    #1
    1. Advertising

  2. You'll probably want to use a union.

    select companyname from suppliers union select shipcity from orders

    try this on Northwind, it'll return the companynames and shipcity in one
    long list.

    HTH

    Pete
    --
    http://www.xboxracing.net/


    "JIM.H." wrote:

    > Hello,
    > I have two Tables: Table1: GroupID1, GroupName1 and Table2:GroupID2,
    > GroupName2.
    >
    > I have only one dropdown list (DropDownList1) in my application and through
    > a stored procedure I want to populate my DropDownList1 from GroupName1 and
    > GroupName2. How should I write my query?
    > Thanks,
    > Jim.
    >
     
    =?Utf-8?B?UGV0ZQ==?=, Jun 6, 2005
    #2
    1. Advertising

  3. Can you give me an example?

    "Eliyahu Goldin" wrote:

    > Jim,
    >
    > You need to join 2 tables with a UNION query.
    >
    > Eliyahu
    >
    > "JIM.H." <> wrote in message
    > news:...
    > > Hello,
    > > I have two Tables: Table1: GroupID1, GroupName1 and Table2:GroupID2,
    > > GroupName2.
    > >
    > > I have only one dropdown list (DropDownList1) in my application and

    > through
    > > a stored procedure I want to populate my DropDownList1 from GroupName1 and
    > > GroupName2. How should I write my query?
    > > Thanks,
    > > Jim.
    > >

    >
    >
    >
     
    =?Utf-8?B?SklNLkgu?=, Jun 6, 2005
    #3
  4. Jim,

    You need to join 2 tables with a UNION query.

    Eliyahu

    "JIM.H." <> wrote in message
    news:...
    > Hello,
    > I have two Tables: Table1: GroupID1, GroupName1 and Table2:GroupID2,
    > GroupName2.
    >
    > I have only one dropdown list (DropDownList1) in my application and

    through
    > a stored procedure I want to populate my DropDownList1 from GroupName1 and
    > GroupName2. How should I write my query?
    > Thanks,
    > Jim.
    >
     
    Eliyahu Goldin, Jun 6, 2005
    #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. huobazi

    Can NOt AutoPostBack for two DDL

    huobazi, Jul 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    530
    huobazi
    Jul 2, 2003
  2. Marina
    Replies:
    0
    Views:
    952
    Marina
    Aug 12, 2003
  3. =?Utf-8?B?SklNLkgu?=

    Q: populate ddl from stored procedure

    =?Utf-8?B?SklNLkgu?=, Apr 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    413
    Craig Deelsnyder
    Apr 11, 2005
  4. Laura Grahame via .NET 247

    Two ddl's in different web grid cells

    Laura Grahame via .NET 247, Sep 20, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    146
    Laura Grahame via .NET 247
    Sep 20, 2004
  5. Enjoy Life
    Replies:
    2
    Views:
    324
    Roland Hall
    Feb 23, 2005
Loading...

Share This Page