Questions tagged [command-timeout]
53 questions
77
votes
10 answers
How to set CommandTimeout for DbContext?
I am looking a way to set CommandTimeout for DbContext. After searching I found the way by casting DbContext into ObjectContext and setting value for CommandTimeout property of objectContext.
var objectContext = (this.DbContext as…

Yara
- 4,441
- 6
- 42
- 62
33
votes
3 answers
Set Command Timeout in entity framework 4.3
I cannot find the a way to set the command timeout of a linq query using entity framework 4.3 and its' DbContext.
How do I increase Commandtimeout in entity framework?
EDIT
I am actually looking for Command Timeout increase. I confused the two, it…

Saher Ahwal
- 9,015
- 32
- 84
- 152
27
votes
1 answer
Set Command Timeout in EF 6
I want to set command timeout for query execution, currently I am doing context.Database.CommandTimeout = 90; but i feel this is not working,
I tried checking the process logs in database but found the time difference was always less than 90sec.…

Ali
- 427
- 1
- 4
- 14
25
votes
5 answers
SqlCommand object, what length of time for CommandTimeout?
How do I decide what length of time to use as a timeout when using an SqlCommand object?
On parts of the code I'm working on (written by somebody else) I have:
cmd.CommandTimeout = 60;
Which I think is quite short. However, I have seen some people…

bobble14988
- 1,749
- 5
- 26
- 38
23
votes
3 answers
How do you set Command Timeout in Linqpad?
I have recently started using LinqPad, and bought the Autocomplete option and am really loving it. This is an excellent product!
I wanted to ask if there is a way for me to control the command timeout that used when querying a SQL Server database…

blairh
- 243
- 2
- 5
14
votes
1 answer
Set custom default CommandTimeout for all new Command Objects
The default CommandTimeout value is 30 seconds. You can manually change the value on an instance of the command object by doing the following
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandTimeout = 60
Is there a way to specify a…

KyleMit
- 30,350
- 66
- 462
- 664
12
votes
5 answers
If my C# times out with a stored procedure call, does the procedure continue running?
I have just a general type of question. If I have a C# application that calls a SQL Server stored procedure, and the C# application times out, does the procedure call on the server continue running to it's completion?

Wizaerd
- 235
- 3
- 15
9
votes
3 answers
How to set CommandTimeout
I am using Microsoft.SqlServer.Management.Smo.
My Code:
Server server = new Server(new ServerConnection( new SqlConnection(ConnectionString));
server.ConnectionContext.ExecuteNonQuery(script);
I want to set CommandTimeout for it like we do with…

Dr. Rajesh Rolen
- 14,029
- 41
- 106
- 178
7
votes
2 answers
How do you set the command timeout in SSIS?
I have a datareader source firing some sql which takes longer than 30 seconds to run, so it's timing out. I can not find a command timeout property on the datareader source component, or the data flow task. Is there some way to set a longer…

Jeremy
- 44,950
- 68
- 206
- 332
6
votes
1 answer
How to set Nhibernate LINQ Command Timeout using Session.Query
Is anyone aware of a way to set the UnderlyingCriteria when using Session.Query?
I'm trying to set a more restrictive command timeout (or query timeout) for one specific query and I am trying to avoid adding that constraint on the connection or…

Kingpin2k
- 47,277
- 10
- 78
- 96
6
votes
1 answer
Entity Framework Migrations: Timeout SqlException during migrating
Sql Server is accessible. I want to migrate database using Entity Framework migrations. There i have "Images" table with 130k records having images. In migration there "INDEX" added to these table using "CREATE INDEX". I get SqlException that…

Alex
- 183
- 1
- 12
5
votes
2 answers
Oracle .net Provider CommandTimeout not worked
I am trying to change the command timeout for a OracleCommand query, but it is not worked so no timeout exception is not fired.
used Oracle.ManagedDataAccess.dll (4.121.2.0)
using (OracleConnection _connection = new…

Fatih Şimşek
- 155
- 1
- 10
4
votes
1 answer
How to set a default NHibernate CommandTimeOut default value
How can i set an Session.DBCommand.CommandTimeOut NHibernate default value with Castle ActiveRecord?
this config line don't work.
edit: i need some…

manuellt
- 669
- 2
- 7
- 19
4
votes
1 answer
EF Core Command Timeout Not Taking Effect
I am finding that neither the DatabaseFacade.SetCommandTimeout method nor the SqlServerDbContextOptionsBuilder.CommandTimeout method are having any effect on my code and instead a long running SQL command just continues indefinitely.
My context…

DenverCoder9
- 1,119
- 3
- 16
- 30
4
votes
2 answers
SMO ConnectionContext.StatementTimeout setting is ignored
I am successfully using Powershell with SMO to backup most databases. However, I have several large databases in which I receive a "timeout" error "System.Data.SqlClient.SqlException: Timeout expired". The timout consistently occurs at 10 minutes. I…

Chip Wood
- 1,246
- 1
- 10
- 16