dataset relate it

  • Thread starter Thread starter JFB
  • Start date Start date
J

JFB

Hi Folks,
I have two tables in one dataset customers and orders.
If I select a customer form a combo box, how can I set the where statement
for the orders table?
I want to display all the orders for that particular customerID in dynamic
way.
Any samples??
Tks for you help.
JFB
 
There are hundreds of northwind examples on using data relations within the
dot net framework.
 
Sorry... I'm trying to be nicer about it... I realize that was a little
harsh, my bad...

Alright, what you want to learn about is called Data relations within .NET

specifically, your looking to learn ADO.NET (which is way different, and yet
very simliar to ADO 2.7/8)

The cool thing about the designer (and this ONLY works in windows forms) is
the ability to "walk" the relationship chain, that is, when you define a
relationship within your dataset, the MDE can interpret that relationship
and create dynamic binding for you with you writing absolutly no code.

If you look at PlanetSourceCode.com or devx, or the MSDN library, search for
anything to do with the Northwind database, there are so many examples of
how to do relationships its not even funny. But it is a wonderful tool.

Your question regarding the Where clause.. you don't set that in your
dataset, you set that in your data adapter... A dataset is a representation
of disconnected data (unlike ADO pre.net which used stateful connections).
It updates the database through DataAdapters which execute your actual SQL
statements. it's a lot of fun to learn about, but there is a LOT of
information there..

be sure to check out the microsoft adonet newsgroup as well.

HTH
-CJ
 
Here I go giving a nice detailed explanation to help a user understand...
And Cor gets the credit as usual. =)

Don't make me call you "Nick"

=)
 
Back
Top