"Could not find stored procedure..." error

Posts   
 
    
jnong
User
Posts: 9
Joined: 02-Feb-2007
# Posted on: 02-Feb-2007 20:02:52   

My stored procedure is named "usp_MonthlyUsage_GetYearlySummaryByUserAndDate" and I'm calling it from my code using the generated code as follows:

DataTable dtYearlyUsageSummary = RetrievalProcedures.UspMonthlyUsageGetYearlySummaryByUserAndDate(GetSelectedUserID, startDate, endDate);

It compiles fine, but when executed it gave the error seen here:

http://www.lnong.com:443/images/error.jpg

I found this post http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6200 and it seems very similar to my error. However, I dont think my SP is improperly named. Or is it? What is my problem then?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 02-Feb-2007 22:20:32   

Do you use catalog name overwriting?

Frans Bouma | Lead developer LLBLGen Pro
jnong
User
Posts: 9
Joined: 02-Feb-2007
# Posted on: 02-Feb-2007 22:51:51   

Otis wrote:

Do you use catalog name overwriting?

Where is this catalog overwriting option being set? In the App.config? I looked in there and there's nothing about catalog overwriting so I would say we are not using it.

FYI, we are using LLBLGen v.2.0.0.0 Final.

Also, how can I use the code example (below) you provided for testing? I pasted it into my project but all the class names and method calls (such as DataAccessAdapter, Assert, DynamicQueryEngine) are unrecognized. Is there a specific LLBLGen namespace that I should be using?

public void ProcNameManglingWithWackyProcNameTest() { string procName = "[emda_cms2].[dbo].[sp_CaseStudies#SetLiveStatus]"; DataAccessAdapter adapter = new DataAccessAdapter(); string newName = adapter.ProcNameChanger(procName); Assert.AreEqual(procName, newName); }

public string ProcNameChanger(string storedProcedureToCall) { DynamicQueryEngine dqe = (DynamicQueryEngine)CreateDynamicQueryEngine(); string procName = dqe.GetNewPerCallStoredProcedureName(storedProcedureToCall); procName = DynamicQueryEngine.GetNewStoredProcedureName(procName); return procName; }

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 03-Feb-2007 11:30:27   

The catalog you connect to in the connection string, is that the catalog which also has the stored procedure you're trying to call? Because sqlserver can't find the procedure you're trying to call in that particular catalog.

Frans Bouma | Lead developer LLBLGen Pro