How can I stop time out error for executing SQL query in ASP.Net? I researched in Google but I couldn't solve my problem correctly.
Time Out Error in ASP.Net
9.6k Views Asked by Sayanthan At
2
There are 2 best solutions below
0
Stefano.net
On
Please consider you have 2 timeout to deal with when you access database via ADO.net
ConnectionTimeout
set in connection string: it's the time in seconds asp.net will time out in opening a connection
and
CommandTimeout
es: SqlCommand cmd = new SqlCommand();
cmd.CommandTimeout = .....;
it's the time in seconds the sql command will timeout.
Stefano
Related Questions in ASP.NET
- Create an IIS web request activity light
- Writing/Overwriting to specific XML file from ASP.NET code behind
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- Getting deeply embedded XML element values
- What is best way to check if any of the property of object is null or empty?
- NuGet - Given a type name or a DLL, how can I find the NuGet package?
- ASP-MVC Code-first migrations checkbox not active
- How do i add onclient click to my jquery button
- Jquery: Change contents of <select> tag dynamically
- Retrieving data from Oracle database
- ASP.NET: Fill Textbox field upon dropdownlist selection by user
- Why web API return 404 when deploy to IIS
Related Questions in SQL-SERVER
- SQL server not returning all rows
- Big data with spatial queries/indexing
- Conditional null constraint on Null
- SQL Query - Order by String (which contains number and chars)
- Optimising a slow running SQL Server Stored procedure ordered by calculated fields to return a closest match
- Dynamics CRM Publishing Customizations - Multi Developers
- Is there anyway to set the relationship of many tables from Model?
- Implementation of Rank and Dense Rank in MySQL
- ORM Code First versa Database First in Production
- MVC : Insert data to two tables
- Data streams in case of Merge
- table with multiple IDs but seperate notes need sorting (Tried SQL code to make a union query)
- SQL table Partitioning by Year with ColumnStore index implemented on the table
- Defining which network to use for SQL Server 2012 Management Studio
- Fill a week days in a table with preceding Sundays value
Related Questions in CONNECTION-TIMEOUT
- Stored procedure timesout called from code, executes ok from SSMS
- Non-blocking SSL socket negotiation in Ruby. Possible?
- Connection Timeout after several successful requests jQuery.ajax
- How to test JAX-WS connection timeout
- Connect to VM on Fiware Lab: Connection timed out
- NSXMLParser initWithContentsOfURL with dispatch_async( dispatch_get_global_queue(0, 0), ^{ timeout
- Python socket server only works sometimes
- Microsoft Hive ODBC driver 2.1.5 timeout
- Indy TIdTCPClient ConnectTimout not working
- can't debug mobile native app with tizen studio ide
- PHP cURL connection timeout in different port
- "failed to open stream: Connection timed out" even though the remote site is up and running
- Server timeout error on uploading videos from Android/IOS to Node Server
- Play akka connection Timed out
- Openshift app not responding
Related Questions in COMMAND-TIMEOUT
- Oracle .net Provider CommandTimeout not worked
- INSERT timeout during online index rebuild
- How to set Nhibernate LINQ Command Timeout using Session.Query
- Partial Class Table Adapter is null
- Command Timeout parameter in postgresql connection string is not working properly in npgsql
- Entity Framework Migrations: Timeout SqlException during migrating
- Time Out Error in ASP.Net
- EF Core Command Timeout Not Taking Effect
- Set custom default CommandTimeout for all new Command Objects
- How do you set the command timeout in SSIS?
- Set Command Timeout in entity framework 4.3
- Change CommandTimeout Default Value globally
- How to support Command Time out in mysql version 5.6? I am looking for a CommandTimeout option similar to that of ADO .NET but in python
- Change CommandTimeout of SSIS OleDB Source programmatically?
- Why is timeout occurring while executing a stored procedure in C# even after increasing the commandtimeout property?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think your problem is about CommandTimeOut.The time (in seconds) to wait for the command to execute. The default is 30 seconds. Here is full example. Otherwise, you should set the ConnectionTimeOut in your database connection string. Something like that
If you use the UpdatePanel, set the AsyncPostBackTimeout.
to be more sure