Skip to main content

Hi,


I want to query data from SQL Server in one of the activities in a workflow. Further I want to pass this data to external application through WCF Service. The only way wcf can be called from workflow is  through server event code. Therefore SQL Server data should be available in server event code itself. What is the recomended make SQL Server data available?   


1)   By using SmartObject event and storing the data in datafields and accessing the datafields in server event code.  But the data returned consists of many rows. How can I map and store them in datafields.


2) I dont want to make use of API to access and invokde SmartObject methods in server event code.


Can someone please suggest me an optimum way to access SQL Server data where data returned consists of more than one row?


Regards,


Gaurav 

If you are using multiple rows, I would recommend storing the data in a Process XML field. Retrieve the data using SQL and store the populated DataTable data by calling its WriteXml method in your Proc XML field.


Restoring will be the reverse, loading data into the table with the ReadXml method. This table can then be used to populate the WCF Service.


Hi,


Thanks for your reply.


So, the solution you suggested is to use SmartObjects to retrieve data from SQL Server. And then use API's in Server Event code to connect to SmartObjects and store the SmartObjectList data into Proc XML fields. Is there a way similar to using SmartObject Events where in multiple rows returned can  directly be mapped to proc XML field. 


Regards,


Gaurav


 


You can use whatever you prefer to retrieve the rows. Stored procedures or SmartObjects. The point is that you should store it in an XML field to cater for the unknown number of rows.


Reply