calling a stored procedure which calls another stored procedure

Posts   
 
    
dbansal
User
Posts: 8
Joined: 16-Jun-2009
# Posted on: 10-Jul-2009 18:20:07   

Hello,

I am using the following. Microsoft Visual Studio 2008 coding in c#

Post the LLBLGen Pro version + buildnr: Version 2.6

Post the template group + .NET version you're using: Using selfservicing. Visual Studio 2008 .net 3.5

Post the database type and version you're using: Microsoft SQL Server 2000

The run time library version for file: SD.LLBLGEN.PRO.ORMSUPPORTCLASSES.NET20.DLL located in C:\Program Files\Solutions Design\LLBLGen Pro v2.6 Demo\RuntimeLibraries\DotNET20\ORMSupportClassesDebugBuild.

File version: 2.6.9.420

I also found this file at another location : SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll located in: C:\Program Files\Solutions Design\LLBLGen Pro v2.6 Demo\RuntimeLibraries\DotNET20

File version: 2.6.9.511

I am attempting to call an action stored procedure. I can call the procedure just fine within my program. However, the store procedure also calls upon another stored procedure which has been added to the action stored procedure calls. However, when I try to execture the initial stored procedure I get the following error:


Could not find stored procedure 'SPR_QryAQRExpectedLoss'. 
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 'SPR_QryAQRExpectedLoss'.

Source Error: 


Line 177:                   connectionOpenedLocally = true;
Line 178:               }
Line 179:               toReturn = command.ExecuteNonQuery();
Line 180:           }
Line 181:           finally


Source File: C:\Documents and Settings\u00\My Documents\LLBLGen Pro Projects\HelperClasses\DbUtils.cs   Line: 179 

Stack Trace: 


[SqlException (0x80131904): Could not find stored procedure 'SPR_QryAQRExpectedLoss'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
   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.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
   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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
   CIMS.HelperClasses.DbUtils.CallActionStoredProcedure(String storedProcedureToCall, SqlParameter[] parameters, ITransaction transactionToUse) in C:\Documents and Settings\u002698\My Documents\LLBLGen Pro Projects\HelperClasses\DbUtils.cs:179
   CIMS.StoredProcedureCallerClasses.ActionProcedures.SprAqrportfolioElossCeagradeV2007(String parReportType, String parRegion, String parExam, DateTime parDate) in C:\Documents and Settings\u002698\My Documents\LLBLGen Pro Projects\StoredProcedureCallerClasses\ActionProcedures.cs:3455
   CIMSWEB.ManagementInformation_ExamSetup.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\u002698\My Documents\Visual Studio 2008\Projects\CIMSWEB\CIMSWEB\Reports\aqratingexpectedloss\aqratingexpectedloss.aspx.vb:8
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Thanks!!!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 10-Jul-2009 21:08:03   

Are you using Catalog name overwriting? What is the real name of the Stored procedure? What is the Generated SQL at that point?

David Elizondo | LLBLGen Support Team
dbansal
User
Posts: 8
Joined: 16-Jun-2009
# Posted on: 15-Jul-2009 22:55:24   

deleted..

dbansal
User
Posts: 8
Joined: 16-Jun-2009
# Posted on: 15-Jul-2009 22:55:35   

daelmo wrote:

Are you using Catalog name overwriting? What is the real name of the Stored procedure? What is the Generated SQL at that point?

The name of the procedure calling the other procedure is: Spr_AQRPortfolioElossCEAGrade_v2007. The name of the procedure being called is:SPR_QryAQRExpectedLoss

I am not sure if I am using catalog name overwriting..

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 16-Jul-2009 05:58:08   

dbansal wrote:

I am not sure if I am using catalog name overwriting..

Please attach your .config file. Though if you don't know it might be you are not using catalog name overwriting.

The exception is thrown on SqlServer side. Does this storeProcedure (the one you call on your code) works if you execute it on SQLAnalyzer (or some SQLServer console)?

It might also helps is you post (or attach if it's too long) the TRANSACT-SQL of the procedure.

David Elizondo | LLBLGen Support Team