Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error calling Stored Procedure
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Error calling Stored Procedure
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01221719
Message ID:
01221719
Views:
75
I have just installed MM .Net 2.4 and get errors using Stored Procedures to get child details. According to the Jump Start docs, the function should look like this:

OrderDetailList = this.GetEntityList("GetOrderDetailByOrderID",
this.CreateParameter("@OrderID", orderID));

which generates the following code to SQL server:

exec sp_executesql N'
SET FMTONLY OFF; SET NO_BROWSETABLE ON; GetOrderDetailByOrderID, N'
@OrderID int', @OrderID = 10248

This gives an unrecoverable error and I had to change the code as follows:

OrderDetailList = this.GetEntityList("execute GetOrderDetailByOrderID @OrderID = @P1",
this.CreateParameter("@P1", orderID));

The call to SQL server then works:

exec sp_executesql N'
SET FMTONLY OFF; SET NO_BROWSETABLE ON; execute GetOrderDetailByOrderID @OrderID = @P1', N'@OrderID int', @P1 = 10248

Should my SQL server accept the original code or is there an error in the SQL templates for the framework?
Next
Reply
Map
View

Click here to load this message in the networking platform