Standard way of doing ...

Discussion in 'ASP .Net' started by Lerp, May 12, 2004.

  1. Lerp

    Lerp Guest

    Hi all,

    I am building an app that has a lot of one to many relationships and was
    curious as to the best method in displaying rows of data from both tables on
    the same line.

    ie:


    row1 of 100 for example in my datagrid:

    customerid(1st table), firstname(1st table), lastname(1st table),
    orderid(2nd table), ordertitle(2nd table), orderdate(2nd table) etc....



    Currently I am using join queries with column aliases and binding this to my
    datagrid and using these to display the data from both tables in the same
    row iteration of my datagrid. Is this pretty much the standard method of
    performing this type of task?

    Also, I am assuming that I set the Parent table when I use the fill method
    on my adapter? (CUSTOMER Table being the parent between customer and
    orders)

    ie:
    .......
    Dim myCmdb as New SqlDataAdapter(strSQLb, MyConn)
    myCmdb.fill(ds, "CUSTOMER")
    .......



    Any insight would greatly be appreciated as I have built this same page
    several different ways and would like to know what other people think,
    thanks

    P.S excuse my newbness to .NET, I'm converting..lol :)

    Cheers, Lerp
     
    Lerp, May 12, 2004
    #1
    1. Advertising

  2. Lerp

    DalePres Guest

    You can display the childrows in a dropdown list or listbox nested within
    the line of your datagrid, datalist, or repeater control that you use for
    displaying the parent table. Search for the words: nested dropdownlist
    datalist. You'll find dozens of articles in google, or MSDN.

    Dale

    "Lerp" <> wrote in message
    news:%...
    > Hi all,
    >
    > I am building an app that has a lot of one to many relationships and was
    > curious as to the best method in displaying rows of data from both tables

    on
    > the same line.
    >
    > ie:
    >
    >
    > row1 of 100 for example in my datagrid:
    >
    > customerid(1st table), firstname(1st table), lastname(1st table),
    > orderid(2nd table), ordertitle(2nd table), orderdate(2nd table)

    etc....
    >
    >
    >
    > Currently I am using join queries with column aliases and binding this to

    my
    > datagrid and using these to display the data from both tables in the same
    > row iteration of my datagrid. Is this pretty much the standard method of
    > performing this type of task?
    >
    > Also, I am assuming that I set the Parent table when I use the fill method
    > on my adapter? (CUSTOMER Table being the parent between customer and
    > orders)
    >
    > ie:
    > ......
    > Dim myCmdb as New SqlDataAdapter(strSQLb, MyConn)
    > myCmdb.fill(ds, "CUSTOMER")
    > ......
    >
    >
    >
    > Any insight would greatly be appreciated as I have built this same page
    > several different ways and would like to know what other people think,
    > thanks
    >
    > P.S excuse my newbness to .NET, I'm converting..lol :)
    >
    > Cheers, Lerp
    >
    >
     
    DalePres, May 13, 2004
    #2
    1. Advertising

  3. Lerp

    Lerp Guest

    Thank you Dale, I will look into that to se if it what I need. I could
    apply the same method but with dropdown boxes correct, or do I have to use
    list controls?

    Cheers, Lerp


    "DalePres" <> wrote in message
    news:...
    > You can display the childrows in a dropdown list or listbox nested within
    > the line of your datagrid, datalist, or repeater control that you use for
    > displaying the parent table. Search for the words: nested dropdownlist
    > datalist. You'll find dozens of articles in google, or MSDN.
    >
    > Dale
    >
    > "Lerp" <> wrote in message
    > news:%...
    > > Hi all,
    > >
    > > I am building an app that has a lot of one to many relationships and was
    > > curious as to the best method in displaying rows of data from both

    tables
    > on
    > > the same line.
    > >
    > > ie:
    > >
    > >
    > > row1 of 100 for example in my datagrid:
    > >
    > > customerid(1st table), firstname(1st table), lastname(1st table),
    > > orderid(2nd table), ordertitle(2nd table), orderdate(2nd table)

    > etc....
    > >
    > >
    > >
    > > Currently I am using join queries with column aliases and binding this

    to
    > my
    > > datagrid and using these to display the data from both tables in the

    same
    > > row iteration of my datagrid. Is this pretty much the standard method

    of
    > > performing this type of task?
    > >
    > > Also, I am assuming that I set the Parent table when I use the fill

    method
    > > on my adapter? (CUSTOMER Table being the parent between customer and
    > > orders)
    > >
    > > ie:
    > > ......
    > > Dim myCmdb as New SqlDataAdapter(strSQLb, MyConn)
    > > myCmdb.fill(ds, "CUSTOMER")
    > > ......
    > >
    > >
    > >
    > > Any insight would greatly be appreciated as I have built this same page
    > > several different ways and would like to know what other people think,
    > > thanks
    > >
    > > P.S excuse my newbness to .NET, I'm converting..lol :)
    > >
    > > Cheers, Lerp
    > >
    > >

    >
    >
     
    Lerp, May 13, 2004
    #3
  4. Lerp

    DalePres Guest

    I have done it by starting with a list control and then displaying the child
    rows in a list control or a drop down.

    I'm not clear if you're asking about doing two dropdownlists, or about a
    list control with the child table in dropdown list. I haven't done related
    dropdowns in ASP.Net but that's a relatively common thing in client side
    scripting using JavaScript. For ASP.Net, I'd do related listboxes by
    setting AutoPostBack on for the parent dropdownlist. Cache the tables that
    will be used to populate the child dropdown list and just change the
    datasource/datamember for the child dropdownlist and call DataBind() on the
    child, in yourSelectedIndexChanged event handler.

    Dale

    "Lerp" <> wrote in message
    news:...
    > Thank you Dale, I will look into that to se if it what I need. I could
    > apply the same method but with dropdown boxes correct, or do I have to use
    > list controls?
    >
    > Cheers, Lerp
    >
    >
    > "DalePres" <> wrote in message
    > news:...
    > > You can display the childrows in a dropdown list or listbox nested

    within
    > > the line of your datagrid, datalist, or repeater control that you use

    for
    > > displaying the parent table. Search for the words: nested dropdownlist
    > > datalist. You'll find dozens of articles in google, or MSDN.
    > >
    > > Dale
    > >
    > > "Lerp" <> wrote in message
    > > news:%...
    > > > Hi all,
    > > >
    > > > I am building an app that has a lot of one to many relationships and

    was
    > > > curious as to the best method in displaying rows of data from both

    > tables
    > > on
    > > > the same line.
    > > >
    > > > ie:
    > > >
    > > >
    > > > row1 of 100 for example in my datagrid:
    > > >
    > > > customerid(1st table), firstname(1st table), lastname(1st table),
    > > > orderid(2nd table), ordertitle(2nd table), orderdate(2nd table)

    > > etc....
    > > >
    > > >
    > > >
    > > > Currently I am using join queries with column aliases and binding this

    > to
    > > my
    > > > datagrid and using these to display the data from both tables in the

    > same
    > > > row iteration of my datagrid. Is this pretty much the standard method

    > of
    > > > performing this type of task?
    > > >
    > > > Also, I am assuming that I set the Parent table when I use the fill

    > method
    > > > on my adapter? (CUSTOMER Table being the parent between customer and
    > > > orders)
    > > >
    > > > ie:
    > > > ......
    > > > Dim myCmdb as New SqlDataAdapter(strSQLb, MyConn)
    > > > myCmdb.fill(ds, "CUSTOMER")
    > > > ......
    > > >
    > > >
    > > >
    > > > Any insight would greatly be appreciated as I have built this same

    page
    > > > several different ways and would like to know what other people think,
    > > > thanks
    > > >
    > > > P.S excuse my newbness to .NET, I'm converting..lol :)
    > > >
    > > > Cheers, Lerp
    > > >
    > > >

    > >
    > >

    >
    >
     
    DalePres, May 14, 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. steve.leach

    How standard is the standard library?

    steve.leach, Apr 18, 2005, in forum: Python
    Replies:
    1
    Views:
    418
    Christos TZOTZIOY Georgiou
    Apr 18, 2005
  2. funkyj
    Replies:
    5
    Views:
    1,184
    funkyj
    Jan 20, 2006
  3. Replies:
    5
    Views:
    885
  4. Sriram Srinivasan
    Replies:
    13
    Views:
    596
    Benjamin Kaplan
    Nov 12, 2009
  5. Xeno Campanoli / Eskimo North and Gmail
    Replies:
    2
    Views:
    191
    Phlip
    May 5, 2010
Loading...

Share This Page