SQL Query task - Cannot serialize the DataTable
I am trying to use the new SQLQuery task in a workflow in Essentials 3.10.
The Connection is :
Connection string:Data Source=Servername\SQL;Initial Catalog=Databasename;Integrated Security=False;User ID=username;Password=password
Providername: = System.data.SqlClient
The Command is set to: Select * From Table Name
The Parameters has been left blank
The Results is set to DTTable1
DTtable1 is a variable of type System.data.datatable.
Every time the workflow is run the following error message is shown: Cannot serialize the DataTable. DataTable name is not set.
How do i properly use the SQLQuery task?
Thanks,
Dan
-
I managed to get this working by adding a AddToDataSet task under the SqlQuery task.
0 -
Dan,
You need to do a data table assign like so:
With the Assign Activity: dataTable.TableName = variable
The variable can be a string. Make sure you give it a name under Default. ex: "myTable"
0 -
Thanks Ryan. That makes complete sense.
My next thought is that this should never work if the data table name is not assigned. However, i created the workflow below which runs perfectly even through the data table name is not assigned.
/customer/servlet/servlet.FileDownload?file=00P6000000e889qEAA
Is it possible that assigning a name to the data table is done in the background as part of the AddToDataSet task?
0 -
I am starting to figure out the sql query workflow activity and I really need a complete workflow example so I can parse out the values from the table and use them in the workflow. Can anyone provide some simple workflow snippet of athe sqlquery and getting the results?
J
0 -
Hi Dan,
How Can I set DataTableName ?
As you know, using Assign activity, it does not allow us to set the property of Table name the DataTable.TableName level
Thanks,
Hamid
0 -
Hi Hamid
you should be able to use in an Assign activity:
myDataTable.DataTableName = "TheTableName"
Regards
Ralph
0 -
Thanks
but I got this Error :
/customer/servlet/servlet.FileDownload?file=00P6000000e88POEAY
0 -
Hamid,
The correct property is "tablename". See https://support.geocortex.com/using-a-workflow-to-generate-a-multi-layer-report-with-map-1 for an example of how table names are set (screenshot below).
/customer/servlet/servlet.FileDownload?file=00P6000000e88PTEAY
Hope his helps,
--Alejandro
0 -
That will teach me to rely on my memory ;-)
Ralph
0
Please sign in to leave a comment.
Comments
9 comments