Timeout Issue in SQLBulkCopy

Hi @Allan_Zimmermann,

I use below code to do sql bulk upload from c# datatable. Even though, I increased the bulkcopytimeout to 1 hour, my workflow kicks out in approximately 2 minutes with
“The timeout period elapsed prior to completion of the operation or the server
is not responding.”

Is there an OpenRPA setting which overrides the timeout value? Could you please assist?

using (var connection = new System.Data.SqlClient.SqlConnection(_connectionString))
{
connection.Open();
using (var bulkcopy = new System.Data.SqlClient.SqlBulkCopy(connection))
{
bulkcopy.BulkCopyTimeout = 3600;
bulkcopy.BatchSize = 1000;
bulkcopy.DestinationTableName = _tableToUpload;
bulkcopy.WriteToServer(_reportTable);
}
connection.Close();
}

Thank you,
Rajesh P. N.

If you create the connection you self, then openrpa does not change anything.
No, i cannot help you with the timeout, that is beyond what i will support for free on the forum.
But keep in mind, DataTable is transactional, meaning it keeps track on what was inserted, update and deleted. If you added data to the datatable yourself, WriteToServer will see it, but if you used “read range” all rows are set to unchanged ( see this for details on row state )

Thank you @Allan_Zimmermann. I’ve used Read CSV activity to generate the datatable.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.