Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Standard way of doing ...

Reply
Thread Tools

Standard way of doing ...

 
 
Lerp
Guest
Posts: n/a
 
      05-12-2004
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


 
Reply With Quote
 
 
 
 
DalePres
Guest
Posts: n/a
 
      05-13-2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Lerp
Guest
Posts: n/a
 
      05-13-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
DalePres
Guest
Posts: n/a
 
      05-14-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > 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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the standard way to put a standard set of asserts into acalled subroutine in test/unit? Xeno Campanoli / Eskimo North and Gmail Ruby 2 05-05-2010 10:44 PM
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
What are the standard network functions provided in standard C? disappearedng@gmail.com C Programming 5 06-10-2008 08:57 PM
add pexpect to the standard library, standard "install" mechanism. funkyj Python 5 01-20-2006 08:35 PM
How standard is the standard library? steve.leach Python 1 04-18-2005 04:07 PM



Advertisments