Re: Dataset - Get Values
- From: shapper <mdmoura@xxxxxxxxx>
- Date: Tue, 25 Sep 2007 05:08:25 -0700
On Sep 25, 12:48 pm, Peter Bromberg [C# MVP]
<pbromb...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
The SQL Statement you show will return a single resultset. So the DataSet you
get back from this will have a single DataTable with all the columns.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"shapper" wrote:
Hello,
I have an SQL Stored Procedure that uses Inner Join to return the
records of various related tables:
SELECT * FROM dbo.by27_Blogger_Posts p
LEFT JOIN (
SELECT *
FROM dbo.by27_Blogger_Comments c
LEFT JOIN dbo.by27_Membership_Users u
ON c.AuthorId = u.UserId) AS cu
ON p.PostId = cu.PostId
....
WHEREp.PostId = @PostId
ORDER BY p.PostUpdatedDate
Now I get a dataset with all this data.
How can I, for example, loop through each PostId? And for each PostId
loop through each CommentId associated to it? And of course access the
columns?
The SQL code section I post applies to the 2 tables:
[Posts] > PostId, Title, ...
[Comments] > CommentId, PostId, Body, ...
Thanks,
Miguel
Peter,
I know but the question is:
Is it possible to create the loop I mentioned or should I use various
SELECTs to return various tables?
Thanks,
Miguel
.
- Follow-Ups:
- Re: Dataset - Get Values
- From: sloan
- Re: Dataset - Get Values
- References:
- Dataset - Get Values
- From: shapper
- Dataset - Get Values
- Prev by Date: Re: Hidden Text Field Occasionally Missing Data on Postback
- Next by Date: problem with ajax toolkit
- Previous by thread: Re: Dataset - Get Values
- Next by thread: Re: Dataset - Get Values
- Index(es):
Relevant Pages
|