1. ephraim ben-eliezer
  2. SnapDevelop
  3. Sunday, 19 April 2020 13:31 PM UTC

Has anybody had luck calling SQL Stored Procedures from a SnapDevelop API project?  What is best practice and any sample code?  I'm interested in both Resultsets and Output parameters if possible.

Also, in your migration from PB tools, can it figure out that a Datawindow has a Stored Procedure source and generate the right code... Also Stored Procedure Update, Delete and Insert?

Accepted Answer
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Monday, 20 April 2020 15:44 PM UTC
  2. SnapDevelop
  3. # Permalink

Hi Ephraim,

You can choose either .NET DataStore or SqlExecutor to call your SQL Stored Procedures.

1. For .NET DataStore, when generating Model by DataWindow Converter, the following attributes can be applied to the model automatically once needed. Then you can use .NET DataStore to CRUD with your predefined stored procedures similar to PB. Refer to:

DwProcedureAttribute (Retrieve data )

https://docs.appeon.com/appeon_online_help/dwconverter2019r2/api_reference/DWNet.Data/ModelAttribute/Class/DwProcedureAttribute/DwProcedureAttribute.html

DwUpdateAttribute & DwUpdateParameterAttribute (Update, Delete and Insert)

https://docs.appeon.com/appeon_online_help/dwconverter2019r2/api_reference/DWNet.Data/ModelAttribute/Class/DwUpdateAttribute/DwUpdateAttribute.html

https://docs.appeon.com/appeon_online_help/dwconverter2019r2/api_reference/DWNet.Data/ModelAttribute/Class/DwUpdateParameterAttribute/DwUpdateParameterAttribute.html

2. For SqlExecutor provided by SnapObjects ORM, please refer to:

ExecuteProcedure

https://docs.appeon.com/appeon_online_help/snapobjects2.0/api_reference/SnapObjects.Data/SqlExecutor/ISqlExecutor/Method/ExecuteProcedure.html

SelectProcedure

https://docs.appeon.com/appeon_online_help/snapobjects2.0/api_reference/SnapObjects.Data/SqlExecutor/ISqlExecutor/Method/SelectProcedure.html

Regards, Logan

Comment
There are no comments made yet.
ephraim ben-eliezer Accepted Answer Pending Moderation
  1. Thursday, 23 April 2020 20:34 PM UTC
  2. SnapDevelop
  3. # 1

Thanks Logan,

Actually I find the Datawindow converter tool does all the .net code for you.   For Select, Insert, Delete and Update!  Amazing!   Good job Appeon.

 

Comment
  1. Armeen Mazda @Appeon
  2. Thursday, 23 April 2020 20:56 PM UTC
Glad you like it!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.