Timeout error with ExecuteQuery
John Slaats
Hi,I'm using (for example)
Dim ScheduleAdapter As SqlDataReader
ScheduleAdapter = SwissAddonFramework.B1Connector.GetB1Connector.ExecuteQuery("Select * From OITM")
But I get timeout errors.
What can I do to set the timeout?
Thanks,
John
Paolo Manfrin
Hi John,you can call the ExecuteQuery passing as parameter a SqlCommand instead of the single query. Using the SqlCommand you can specify the timeout error.
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT * FROM OITM";
cmd.CommandTimeout = 10 * 60; // 10 minutes;
using (SqlDataReader sdr = SwissAddonFramework.B1Connector.GetB1Connector().ExecuteQuery(cmd))
{
// do something
}
Kind Regards,
paolo
John Slaats
Danke
0
Please sign in to leave a comment.
Comments
0 comments