How to set CommandTimeout in SqlHelper.ExecuteDataSet()?

1.3k Views Asked by At

I have a method which uses SqlHelper.ExecuteDataSet():

Private Function UpdateStatusCode(ByVal no As String, ByVal status As String) As Boolean
    sqlConn = New SqlConnection(Conn)
    Dim breturn As Boolean

    Dim param1 As SqlParameter = New SqlParameter("@No", SqlDbType.VarChar, 20)
    Dim param2 As SqlParameter = New SqlParameter("@Status", SqlDbType.Int, 4)
    Dim param3 As SqlParameter = New SqlParameter("@ErrorCode", SqlDbType.Int, 4)

    param1.Direction = ParameterDirection.Input
    param2.Direction = ParameterDirection.Input
    param3.Direction = ParameterDirection.Output
    param1.Value = no
    param2.Value = status
    Dim Table As DataTable = New DataTable()
    Dim sqlrds As DataSet
    sqlrds = SqlHelper.ExecuteDataset(sqlConn, CommandType.StoredProcedure, "sp_UpdateStatus", param1, param2, param3)
    If param3.Value.ToString() = 0 Then
        breturn = True
    Else
        breturn = False
    End If
    sqlConn.Close()
    Return breturn
End Function

How can I change the CommandTimeOut property of the SqlHelper? I've already tried SqlHelper.CommandTimeOut property but it seems .NET 1.1 still haven't support it.

0

There are 0 best solutions below