Tuesday, 16 June 2009

Time Out in ASP.Net Application

Time Out Solution if the application timeout within your preferred time limit:
Connection Timeout:
Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer;Connect Timeout=30";
Command Timeout :
If you give the value as 0, that is (e.Command.CommandTimeout = 0) the application timeout is infinitive

Eg.
Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
e.Command.CommandTimeout = 60
End Sub

Eg:
Protected Sub GetData(ByVal queryName As String)
Dim myconn As New SqlConnection(ConfigurationManager.ConnectionStrings("myconn").ConnectionString)Dim mycommand As New SqlCommand("r_GetCustomQueries", myconn)mycommand.CommandType = CommandType.StoredProcedure

myconn.Open()
mycommand.commandtimeout=600

No comments:

Post a Comment