Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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
 
Old March 2nd, 2008, 05:21 PM
Registered User
 
Join Date: Mar 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginer problem compiling :Stored procedure

Hello..
I am having difficulty compiling the final project of TBH.
I keep getting a message that it cant find a stored procedure.

Can you give me any help or pointers...
I though all you would have to do was run the project as was per
the Begining Asp2.0 book which I though was very informative for a beginner.
With the book Asp 2.0 website programing I cant seem to get the project TBH to compile which is very frustrating.
I know this is due to my lack of knowledge but I wish it was easier to understand on how to get it to work!
That said I do appreciate that the book is very good so I cannot wait to get stuck into it.... but I need to get around... compiling it so it will work for me

Liam
see below

Server Error in '/TBH_Web' Application.
--------------------------------------------------------------------------------

Could not find stored procedure 'tbh_Polls_GetCurrentPollID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'tbh_Polls_GetCurrentPollID'.

Source Error:


Line 91: }
Line 92: else
Line 93: return cmd.ExecuteNonQuery();
Line 94: }
Line 95:




 
Old March 2nd, 2008, 06:54 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

"...compiling it so it will work for me..."

This isn't a compiliation error, it's a run time error. I am looking at the TBH database right now and the stored procedure is, in fact, there. Did you maybe delete it some how?

In any event, to recreate the sproc, double click on the ASPNET.MDF file this will open the server explorer, underneath the data connections node, expand the ASPNET.MDF file, you will see several folders: tables, stored procedures, etc. Right click on the stored procedure folder, select 'Add New Stored Procedure' and enter this code into the window

CREATE PROCEDURE dbo.tbh_Polls_GetCurrentPollID
(
   @PollID int OUTPUT
)
AS
SET NOCOUNT ON

SELECT @PollID = PollID
   FROM tbh_Polls
   WHERE IsCurrent = 1 AND IsArchived = 0

IF @PollID IS NULL
   BEGIN
   SELECT @PollID = -1
   END

Highlight all of the text, right click somewhere on the highlighted area, and choose "run selection" from the context menu. This will add the sproc to the database.

hth.

-Doug

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
 
Old March 17th, 2008, 08:42 AM
Registered User
 
Join Date: Mar 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks man.... for your help... Ill check this out and get back to you.

Liam






Similar Threads
Thread Thread Starter Forum Replies Last Post
stored procedure problem keyvanjan ASP.NET 2.0 Professional 0 September 19th, 2007 06:28 AM
Problem with stored procedure analuz ADO.NET 1 July 18th, 2007 08:33 AM
Stored procedure problem dkspivey SQL Language 2 February 6th, 2006 01:44 PM
Problem In Stored procedure mistry_bhavin Oracle 1 October 11th, 2005 05:15 AM
Stored Procedure Problem brettdavis4 ASP.NET 1.0 and 1.1 Basics 7 November 3rd, 2003 09:46 PM





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