Alessandro Del Sole's Blog

/* A programming space about Microsoft® .NET® */
posts - 159, comments - 0, trackbacks - 0

My Links


Your host

This is me! This space is about Microsoft® .NET® and Microsoft® Visual Basic development. Enjoy! :-)

These postings are provided 'AS IS' for entertainment purposes only with absolutely no warranty expressed or implied and confer no rights.

Microsoft MVP

My MVP Profile

I'm a VB!

Watch my interview in Seattle

My new book on VB 2015!

Pre-order VB 2015 Unleashed Pre-order my new book "Visual Basic 2015 Unleashed". Click for more info!

My new book on LightSwitch!

Visual Studio LightSwitch Unleashed My book "Visual Studio LightSwitch Unleashed" is available. Click the cover!

Your visits

Follow me on Twitter!

CodePlex download Download my open-source projects from CodePlex!

Article Categories


Post Categories

.NET Framework


Help Authoring

Microsoft & MSDN

Setup & Deployment

Visual Basic 2005/2008/2010

LightSwitch: increasing the client-side timeout in code (VB)

There are scenarios in which you need to send a large number of records to a database in LightSwitch or retrieve a large number of records. If the operation becomes too long, this might result in a fault due to a timeout exception. This typically happens if your data source is on a server or on a machine different than yours.

Solving timeout problems in LightSwitch can be done in several ways, some on the server side (as you would do in WCF RIA Services), but also on the client side. This requires making an edit to the Application.vb/cs file, which contains code that is common to the whole application.

To increase the timeout:

  1. in Solution Explorer, double-click Properties
  2. open Screen Navigation tab, then click "Click here to view application code"
  3. In the code editor, set the ClientTimeout property of the Details object with the desired value like in the following example:
    Public Class Application
        Private Sub Application_Initialize()
            Me.Details.ClientTimeout = 1500
        End Sub
    End Class

The assignment is done in the Initialize method hook, which runs at the application startup. In this way you can increase the timeout and allow long running operations on data.


Print | posted on venerdì 9 dicembre 2011 12:10 | Filed Under [ Visual Studio LightSwitch ]


No comments posted yet.

Post Comment

Please add 6 and 3 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET