Re: Selecting Data
From: eric (eriic_at_spam.com)
Date: 06/03/04
- Next message: William Ryan eMVP: "Re: Selecting Data"
- Previous message: dm_dal: "RowState Quirk?"
- In reply to: William Ryan eMVP: "Re: Selecting Data"
- Next in thread: William Ryan eMVP: "Re: Selecting Data"
- Reply: William Ryan eMVP: "Re: Selecting Data"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 3 Jun 2004 14:22:59 -0600
William,
No I am not using "join" in my query. My query is similar to this:
CREATE PROCEDURE GetOrders
@OrderID varchar(10)
AS
SELECT *
FROM Orders O, OrderDetails Od
WHERE O.OrderID = @OrderID AND Od.OrderID = O.OrderID
GO
I am trying to load it into a typed dataset with tables: Order and Order
Details with a data relation using OrderID. I thought that the data
relation would take care of the mapping of data. So, do I need to do two
seperate queries to fill each table or can I use one query like above to
load data into both tables?
Thanks
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:uoDMnCaSEHA.1128@TK2MSFTNGP11.phx.gbl...
> Does your Select Statement have the word JOIN in it? If so, this is the
> problem. The dataset is rejecting what doesn't fit. You need to do two
> separate queries filling the parent table with its adapater and the child
> with its adapter. If you have a typed dataset with the Relation defined,
> then that should be it b/c the DataRelation is already defined.
>
> In general, avoid SQL Statements with the word JOIN in them in ADO.NET
> unless you are positive you want to do otherwise.
>
> --
>
> W.G. Ryan, eMVP
>
> http://forums.devbuzz.com/
> http://www.knowdotnet.com/williamryan.html
> http://www.msmvps.com/WilliamRyan/
> http://www.devbuzz.com/content/zinc_personal_media_center_pg1.asp
> "eric" <eriic@spam.com> wrote in message
> news:%23dyfT4ZSEHA.1732@TK2MSFTNGP09.phx.gbl...
> > I am currently struggling working with data in multiple tables. Is it
> > better to have a single join based query versus seperate queries? I am
> > trying to fill a typed dataset with two tables with a one to many
> > relationship which is similiar to Order-Order Details relationship.
When
> I
> > pass my dataset to be filled in my data access layer using a single
joing
> > based query it only loads the data in the parent table in the dataset
and
> > not the order details table (child). When I display it in a datagrid it
> > shows the data in the order details table however only with the order
> table
> > not in the order details table. What am I doing wrong?
> >
> > Thanks
> >
> >
>
>
- Next message: William Ryan eMVP: "Re: Selecting Data"
- Previous message: dm_dal: "RowState Quirk?"
- In reply to: William Ryan eMVP: "Re: Selecting Data"
- Next in thread: William Ryan eMVP: "Re: Selecting Data"
- Reply: William Ryan eMVP: "Re: Selecting Data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|