Increase SQL timeout with Enterprise Library

U

ujjc001

Hello all-
I'm using the enterprise library for my data calls. I have a sql query
that takes a long time to run and would like to increase the timeout
for that one single call. If I step into the ent lib code I can get at
the connection timeout property and increase that, but I can't get at
it from my code. Any thoughts?
Thanks.
Jeff
 
U

ujjc001

no one? (Just replying a few more times to get back on the main page
for google groups)...
 
Joined
Jul 23, 2008
Messages
1
Reaction score
0
Setting command timeout using Enterprise Library

Use this
dcCommand = dDatabase.GetSqlStringCommand(sSQLCommand);
dcCommand.CommandTimeout = 60;
dDatabase.LoadDataSet(dcCommand, dsDataSet , saTableNames);

Instead of this
dDatabase.LoadDataSet(CommandType.Text, sSQLCommand, dsDataSet , saTableNames);
 
Joined
Jul 28, 2009
Messages
1
Reaction score
0
Hi man,

Look at this


Public Function ConsultarDataset_TimeOut(ByVal Prodecimiento As String, ByVal Parametros As Object()) As DataSet
Try
Dim dcCommand As System.Data.Common.DbCommand
dcCommand = _db.GetStoredProcCommand(Prodecimiento, Parametros)
dcCommand.CommandTimeout = 200

Return _db.ExecuteDataSet(dcCommand)
Catch ex As SqlException
HandleSqlException(ex)
End Try
Return Nothing
End Function


regards, and good proggrammings




ujjc001 said:
Hello all-
I'm using the enterprise library for my data calls. I have a sql query
that takes a long time to run and would like to increase the timeout
for that one single call. If I step into the ent lib code I can get at
the connection timeout property and increase that, but I can't get at
it from my code. Any thoughts?
Thanks.
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top