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
    Likes Received:
    0
    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. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Will Chamberlain

    Assign Text to Footer Label

    Will Chamberlain, Oct 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,865
    Trevor Benedict R
    Oct 3, 2005
  2. =?Utf-8?B?ZGF2aWQ=?=

    JavaScript assigns a value to label control text value?

    =?Utf-8?B?ZGF2aWQ=?=, May 24, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    24,269
    =?Utf-8?B?ZGF2aWQ=?=
    May 26, 2006
  3. Guest
    Replies:
    1
    Views:
    1,141
    =?Utf-8?B?dGlta2xpbmc=?=
    Jun 5, 2006
  4. Guest
    Replies:
    1
    Views:
    816
    Walter Wang [MSFT]
    Jun 6, 2006
  5. GenxLogic
    Replies:
    3
    Views:
    2,293
    andrewmcdonagh
    Dec 6, 2006
  6. asgars
    Replies:
    1
    Views:
    2,717
    Patrice
    May 11, 2010
  7. Paolo

    Two dropdownlist and two tables...

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