Alessandro Del Sole's Blog

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

My Links

News

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 2012

Order my book about VB 2012 on Amazon My book "Visual Basic 2012 Unleashed" is available. Click the cover!

My new book on LightSwitch!

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

Your visits

campusMVP.NET - Tutored online training for Microsoft developers

Follow me on Twitter!

Messenger me!


CyberInstaller Beta Tester

Download CIS 2008!!

CodePlex download Download my open-source projects from CodePlex!

Search the blog



Article Categories

Archives

Post Categories

.NET Framework

Blogroll

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.

Alessandro

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

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 4 and 1 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET