By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

Standard way of doing ...

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <ad***@officience.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2

P: n/a
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" <no****@nomail.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
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" <ad***@officience.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #3

P: n/a
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" <ad***@officience.ca> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
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" <no****@nomail.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
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" <ad***@officience.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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



Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.