Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I am tired of removing this error.

Project is working fine in Local host problem occurs when i upload it on Go Daddy :

It says :

Server Error in '/' Application.
Could not find stored procedure 'ShowHierarchyForum'.
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 'ShowHierarchyForum'.

Source Error:

Line 68:             sqlCommand.Parameters.Add(newSqlParam2);
Line 69:             sqlCommand.Connection = mycon;
Line 70:             SqlDataReader myr = (sqlCommand.ExecuteReader(CommandBehavior.CloseConnection));
Line 71:             return myr;
Line 72:                 


Source File: d:\hosting\9361748\html\App_Code\classes\clsDataAccess.cs    Line: 70

Stack Trace:

[SqlException (0x80131904): Could not find stored procedure 'ShowHierarchyForum'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1953274
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849707
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
   System.Data.SqlClient.SqlDataReader.get_MetaData() +96
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +70
   JumpyForum.clsDataAccess.getForumData(Int32 ArticleId) in d:\hosting\9361748\html\App_Code\classes\clsDataAccess.cs:70
   JumpyForum.Forum.LoadData() in d:\hosting\9361748\html\Forum.aspx.cs:95
   JumpyForum.Forum.Page_Load(Object sender, EventArgs e) in d:\hosting\9361748\html\Forum.aspx.cs:74
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.4223; ASP.NET Version:2.0.50727.4223 
Posted

The error comes from SQL Server.
It means that the server failed to find the procedure with name 'ShowHierarchyForum'

There might be several reasons for that:

* typo in code or on the server - check that the name on the server matches exactly the name you call

* check that the data source is set to the right server

* check that the database name is specified, either it is set in the connection string or it is set by calling ChangeDatabase method on SqlConnection.
 
Share this answer
 
System.Data.SqlClient.SqlException: Could not find stored procedure 'ShowHierarchyForum'.
Well, error says directly what issue it is facing. Your uploaded code failed in finding the stored procedure named 'ShowHierarchyForum' to the database connected.

So, just make sure that the connection string is correct in your config file and you are connecting to right database.
 
Share this answer
 
Comments
Pr!y@ 11-Jun-12 23:23pm    
I have checked "Connection String" is correct
Sandeep Mewara 12-Jun-12 1:42am    
If you are connecting to right database then verify that the SP is present in the referenced database.
Pr!y@ 12-Jun-12 4:04am    
Thanks Sir, You are always help full ....!!! :)
Sandeep Mewara 12-Jun-12 4:39am    
Welcome.
The error message is clear, the SP ShowHierarchyForum is missing on the server. Just create it there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900