C#

Why and Where to use Delegate in C#

I am going to explain why and where we need to use delegates in C#. Let’s suppose we have an investment application, which takes investment from customers and then calculates profit on the basis of investment. We have some rules … Read More

Difference between Action and Func in C#

Difference between Func<T> and Action<T> in C# and where to use them. Let’s suppose we have small program which returns a number using a delegate  static void Main(string[] args){MyCalculations del = MyCalculationsMethod;int value = del.Invoke(5); Console.WriteLine(“Result is: ” +value);}public static … Read More

crm 2011 A webresource with the same name already exists. Use a different name.

Keep getting error below after deleting a web resource file from VS>Organization>Web Resources>Data(XML) I had to delete one of the resource file as it was not deploying updated version. After deletion and on deployment I kept getting above error… Checked … Read More

How to run Asynchronous task and override it

We need to run Asynchronous task due to some requirements but we want that to be override able, unfortunately that is not possible however we can create Asynchronous method but then call that method inside of Synchronous method and make … Read More

CRM Linq The ‘select’ and ‘orderBy’ calls may only reference a single common entity type

When using Linq query in CRM you might come across error below.. “The ‘select’ and ‘orderBy’ calls may only reference a single common entity type” Above error usually comes up if you are joing multiple entites  and returning a value … Read More

How to install a Window Service on server without visual studio tools

If need to install a window service on a server where Visual Studio is not installed or you don’t have Visual Studio tools then follow the steps below 1) You can find InstallUtil.exe at following directoryC:\Windows\Microsoft.NET\Framework64\v4.0.30319 (depending on system it could … Read More

WPF: How to get a selected row value from Datagrid on double click

A very simple of  getting a selected row value from Datagrid on double click… 1) Create a double click event on WPF form/window private void uxABC_MouseDoubleClick(object sender, MouseButtonEventArgs e){ myData decData = uxABC.SelectedItem as MyData; Guid myId = decData.MyId; } … Read More

How to display a new window by double clicking a row in datagrid in WPF

An easy way of displaying a new window in WPF by double clicking a selected row in Data Grid Add a new second window to project Once added, add any datagrid, rows, columns you need to, example Then go FirstWindow.xaml … Read More

wcf service wsdl domain name

When creating a new WCF and hosting locally or dev/prod server you might come across an issue where WSDL will display a URL with computer/local name which is different to URL of service Fro example actual URL might be And … Read More