Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
Error calling Stored Procedure
Versions des environnements
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?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement