General information
Category:
The Mere Mortals .NET Framework
Title:
Error calling Stored Procedure
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only