Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error calling Stored Procedure
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Error calling Stored Procedure
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01221719
Message ID:
01221719
Vues:
72
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
Fil
Voir

Click here to load this message in the networking platform