Blog Archives

Video Tutorial – Asynchronous Programming in .NET 4.5 (Task, async and await) – C# 5.0

Microsoft_DotNET_Logo

This is a great introduction video for Async Programming in .net 4.5 making multi threaded application super easy and bug free. In below tutorial You will learn following concepts Using Task Using Async and Await Keywords in .net 4.5

Tagged with: , ,
Posted in .net, C#, VB.net

How to export grid data as excel in LightSwitch Web Application

lightswitch-excel-web-export

Someone recently asked me how to export LightSwitch grid to excel format. Well sounds easy in Desktop Mode coz there is inbuilt option when you publish application in Desktop mode but what about when application is published as web app?

Posted in LightSwitch, VB.net

How to call StoredProcedure in LightSwitch for custom search screen validation

lightswitch-add-reference0

I recently came across requirement where user asked to perform complex validation before query is fired to return search screen data. So here is my code snippet you can call inside yourqueryname_ProcessQuery Create stored procedure for validation First thing we

Tagged with: ,
Posted in .net, LightSwitch, VB.net

How to provide custom button for search in LightSwitch

lightswitch-disable-auto-refresh

Recently someone asked me how to change default LightSwitch behavior for Search screen. Which is press enter for search. But what if you want to provide Button which user can Press to search data? Here is step-by-step info on how

Tagged with: ,
Posted in .net, LightSwitch, VB.net

How to show delete confirmation in LightSwitch

lightswitch-row-delete-confirm

If you want to ask user before deleting record then write the following code in your screen code editor. Namespace LightSwitchApplication Public Class EditableCustomersGrid Private Sub gridDeleteSelected_Execute() ' Write your code here. If ShowMessageBox("Are you sure you want to delete

Tagged with: ,
Posted in .net, LightSwitch, VB.net

How to set default values for search screen parameters in LightSwitch

LightSwitch-Set-Search-Screen-Default-value-For-Parameter

I recently tried to set default values for my search screen parameters but didn’t find any option. But here is an easy way to do. Goto code view of you Search Screen and type the following code. I had 4

Tagged with:
Posted in .net, LightSwitch, VB.net

Nullable types in C# and VB.net

Have you ever try to assign null to int value in C# or VB Both language has totally different behavior. VB allows you assign Nothing but it will translate to zero on the other end C# throws error “type is

Posted in .net, C#, Tips, VB.net

How to Read Locked file in VB or C#

Have you ever got this error “File is being used by another process” Just try this create simple textfile on disk (e.g. mydata.txt) and open it with Excel… This way its locked (This is my trick to mimic locking of file) Now try

Tagged with: ,
Posted in .net, C#, VB.net