Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
| Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 28th, 2004, 09:55 PM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to flyin
Default Stored Procedure to....

Hello All! I'm back once again. I've had some success creating stored procedures once i understood it, but i'm back for more questions as i am stumped!!

Scenario:
We have two tables.
1) Articles
Fields:
  ArticleID, HeadLine, AuthorID
2) ArticlesDetails
Fields:
 ArticlesDetailsID, ArticleID, Text, LineNumber

Alright well, to give a bit of a description,
the Articles table stores all the information except for the body of hte article, that is stored in the articlesDetails table hence the Text and LineNumber field. I set the length of the Text Field to 500 Characters so if the article body lets say for example is 1000 charaters long, then we have two entries for the articlesDetails table breaking apart the article into two separate portions in the articleDetails table. well if you can't figure out what i'm gonna ask, well here goes.

I need a storedProcedure that accepts an ArticleID

And returns me back one entry that stores the ArticleID, HeadLine, AuthorID, and the Whole article from the details table in the field WholeArticle

so basically i call it like such

sp_GetWholeArticle 321

And that would return me in one entry the entire articles "stuff"

I guess my problem is getting back the representation of all the entries in the details table for the articleID=@ArticleID

any thoughts? thanks

  #2 (permalink)  
Old February 29th, 2004, 02:20 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Ok, its quiet simple! u r goig to have a master & detail table (u'll use it much) anyway...
As I see ArticleID is ur [u]primary key</u> & [u]foreign key</u> in ArticlesDetails table & u have to mach them in order to have a Master-Detail replation.
let me give u a link witch im sure will tell u more better than me:D
http://www.codeproject.com/cs/databa...onaladonet.asp
HTH.

Always:),
Hovik Melkomian.
  #3 (permalink)  
Old March 2nd, 2004, 11:24 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to flyin
Default

thanks for the reply Hovik, the link isn't exaclty what i'm looking for, but it does have some helpful hints. I'll keep plugging away at it

  #4 (permalink)  
Old March 3rd, 2004, 02:01 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

pleasure:D


Similar Threads
Thread Thread Starter Forum Replies Last Post
stored procedure prashant_telkar SQL Server 2000 1 July 9th, 2007 07:57 AM
Stored Procedure jezywrap SQL Server ASP 1 January 3rd, 2007 12:29 AM
stored procedure kdm260 SQL Server 2000 2 June 19th, 2006 04:45 PM
Stored Procedure rajanikrishna SQL Server 2000 0 July 18th, 2005 05:01 AM
Help About Stored Procedure zhuge6 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 May 20th, 2005 09:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.