how to assign a ddbb value to a label using two tables

Discussion in 'ASP General' started by rcast, Jun 14, 2012.

  1. rcast

    rcast

    Joined:
    Jun 14, 2012
    Messages:
    1
    Hi, I need your help on this issue:
    I have two table connected using Join command.
    When I assign a value to the label it works, but since I need to assign two values, and the Join only works when you compare one field for each table, the second values is like the first. Here is the example>

    Table A has ID and name

    Table B has level1 and level2

    I want:

    b.level1 = a.ID (ID on record 1)

    b.level2 = a.ID (ID on record 2)

    I wanto to display a.name using a label command, but seems like label is able to get the first value since I am doing join on A where a.ID=b.level1

    I do not know how to get b.level2=a.ID at the same time b.level1=a.ID

    it is like:

    a.ID = 1

    a.name = "John"

    a.ID = 2

    a.name = "Maria"

    b.level1 = 1

    b.level2 = 2

    using label with level1 and 2:

    eval("level1") it shows 1

    eval("level2") it shows 2

    using label with name:

    eval("name") it shows John

    eval("name") it shows John (here I need to shows Maria instead)

    Tks!
    rcast, Jun 14, 2012
    #1
    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. Will Chamberlain

    Assign Text to Footer Label

    Will Chamberlain, Oct 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,592
    Trevor Benedict R
    Oct 3, 2005
  2. Guest
    Replies:
    1
    Views:
    918
    =?Utf-8?B?dGlta2xpbmc=?=
    Jun 5, 2006
  3. Guest
    Replies:
    1
    Views:
    581
    Walter Wang [MSFT]
    Jun 6, 2006
  4. Paolo

    Two dropdownlist and two tables...

    Paolo, Sep 19, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    121
    Paolo
    Sep 19, 2006
  5. Knut Krueger
    Replies:
    8
    Views:
    252
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page