Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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

Reply With Quote
  #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.
Reply With Quote
  #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

Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:46 PM.


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