Search code examples
visual-studio-lightswitch

LightSwitch v1 shows red X and unable to load data


I have made an application using Visual Studio LightSwitch 2011 (v1) running on Visual Studio 2010 Professional. It is a desktop application, and I use SQL Server Authentication to connect to the database. (Same username/password for all clients).

The application works perfectly for most users, but for 4-5 users, it is showing a red X and says that it is unable to load data. This is the most vague error message ever, and I have no idea what could cause it. The users are all able to access our database from their PCs because some other non-lightswitch applications are working fine. This rules out any network/connectivity issues.

After days of searching and trying to figure this out, I haven't found an easy way to determine what the cause of the red-X error is. Also, the users are located in a different country so I don't have physical access to their machines. The only thing I have to go on is that these users are all running Windows 7 (no firewalls installed). One of them finally did a clean-install of Windows 7, and on installing the application, he got the red-X (unable to load data) error.

Is there any easy way to figure out why lightswitch is unable to load data from our database? (Database = SQL Server 2005)

Thanks for the help.


Solution

  • Check out Eric Erhardt's article. Here's a quote:

    When your application fails to load data successfully, the screen will display a red X and the tool tip will say “Unable to load data. Please check your network connection and try loading again.”

    A little known secret about LightSwitch is that the server has a Diagnostics subsystem integrated with ASP.NET tracing. LightSwitch’s Diagnostics subsystem is a lot more powerful than just telling you what exception was thrown when issuing a query. You can use it to trace through the actions that were requested of the server, and what steps the server took in response to each action. So even if things seem to be working, you can get more information about what your application was actually doing.

    So you can enable diagnostics then open the trace at: your-lightswitch-application-address/trace.axd. You can then check the error details (screenshot taken from the blog article):

    The error as shown from the trace

    Another alternative way is to use Fiddler. It is also explained in the same article.