G
Guest
I've got a potentially long running SQL Server stored procedure. Worst case it may run 6 minutes. Using the SQL Helper ExecuteDataset() method, I'm receiving a "General Network Error" if the procedure runs longer than 35 seconds. It runs to completion if the parameters result in a shorter run time
I assumed that it was because of a command timeout so I modified the SQLHelper class to set the SQLCommand.CommandTimeout value where necessary. Once set this way, the procedure runs to completion, but the CommandTimeout value that I set doesn't seem to make any difference. I can set it to 10 sec or 500 sec and the procedure still runs the 6 minutes or so required and completes
My question is: Does anyone understand what's going on here? Setting commandtimeout removed the "General Network Error" but I'm not sure why, and why does changing the timeout setting not make any difference as far as a timeout
It may help to know that the stored procedure creates a cursor (I know) and runs through it to put records into a temp table, then I select from the temp table to return the records
I use the MS Exception Blocks to log the error. The info follows
2) Exception Informatio
********************************************
Exception Type: System.Data.SqlClient.SqlExceptio
Errors: System.Data.SqlClient.SqlErrorCollectio
Class: 2
LineNumber:
Message: General network error. Check your network documentation
Number: 1
Procedure: ConnectionRead (recv())
Server:
State:
Source: .Net SqlClient Data Provide
TargetSite: System.Data.SqlClient.SqlDataReader ExecuteReader(System.Data.CommandBehavior, System.Data.SqlClient.RunBehavior, Boolean
HelpLink: NUL
StackTrace Informatio
********************************************
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\Data Access v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 56
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\Data Access v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 47
at SWatchData.clsStyle.GetStyleDeleteList(clsDepartmentChoices objDepartmentChoices, clsVendorChoices objVendorChoices, clsStylePeriodChoices objStylePeriodChoices, TimePeriod TimePeriodChoice) in c:\files\stockwatch\swatch.net\SWatch\SWatchData\clsStyle.vb:line 443
Any help would be appreciated!
Thanks. D. Arnold
I assumed that it was because of a command timeout so I modified the SQLHelper class to set the SQLCommand.CommandTimeout value where necessary. Once set this way, the procedure runs to completion, but the CommandTimeout value that I set doesn't seem to make any difference. I can set it to 10 sec or 500 sec and the procedure still runs the 6 minutes or so required and completes
My question is: Does anyone understand what's going on here? Setting commandtimeout removed the "General Network Error" but I'm not sure why, and why does changing the timeout setting not make any difference as far as a timeout
It may help to know that the stored procedure creates a cursor (I know) and runs through it to put records into a temp table, then I select from the temp table to return the records
I use the MS Exception Blocks to log the error. The info follows
2) Exception Informatio
********************************************
Exception Type: System.Data.SqlClient.SqlExceptio
Errors: System.Data.SqlClient.SqlErrorCollectio
Class: 2
LineNumber:
Message: General network error. Check your network documentation
Number: 1
Procedure: ConnectionRead (recv())
Server:
State:
Source: .Net SqlClient Data Provide
TargetSite: System.Data.SqlClient.SqlDataReader ExecuteReader(System.Data.CommandBehavior, System.Data.SqlClient.RunBehavior, Boolean
HelpLink: NUL
StackTrace Informatio
********************************************
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\Data Access v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 56
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\Data Access v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 47
at SWatchData.clsStyle.GetStyleDeleteList(clsDepartmentChoices objDepartmentChoices, clsVendorChoices objVendorChoices, clsStylePeriodChoices objStylePeriodChoices, TimePeriod TimePeriodChoice) in c:\files\stockwatch\swatch.net\SWatch\SWatchData\clsStyle.vb:line 443
Any help would be appreciated!
Thanks. D. Arnold