31-05-2012 File reference is when you add reference to a dll file. This is what you do when you have to use a 3rd party dll. The project reference is when you load a project into your solution and then add reference to it. Rather than adding a reference to its output dll file. ProjectContinue reading “File Reference vs. Project Reference in .NET”
Author Archives: Menol
List.Find Method in C#.NET
30-05-2012 The List.Find method requires a delegate function which can compare an object of the same type of the list and return if the object matches the target object. You can either declare a delegate separately or use following easy shortcut. Following example populates a list of people and then finds for a particular entryContinue reading “List.Find Method in C#.NET”
Comparing Objects in .Net – Reference Equality
30-05-2012 Comparing two objects returns true if they point to the same entry of the heap. Menol ILT
How to Implement a Background Worker Thread that Supports Cancellation (How to Stop A Background Thread)
30-05-2012 The background worker in .net provides a method CancelAsync() to cancel a background worker. However, calling this method will not stop a worker thread there has to be several things you have to implement before. 1. First of all, for a BackgroundWorker to respond to a CancelAsync, you must set the WorkerSupportsCancellation flag. 2.Continue reading “How to Implement a Background Worker Thread that Supports Cancellation (How to Stop A Background Thread)”
Cannot Find Contents Of System.Configurations?
29-05-2012 The visual studio shows the System.Configurations namespace by default. But it doesn’t show that namespace content (such as System.Configuration.Configuration class) by default. You have to add a new reference to System.Configurations namespace explicitly. This is more confusing as it allows you to add using System.Configuration; in the class but then doesn’t show the contentsContinue reading “Cannot Find Contents Of System.Configurations?”
How to Convert a Stack to an Array Without Losing The LIFO Order
29-05-2012 The index of elements in a stack increments. i.e. the latest item would have the largest index (which is equal to Stack.Length – 1). But when you use Stack.ToArray() method it returns items in the other way. So the first item in the array is the last item you put in the stack. ThisContinue reading “How to Convert a Stack to an Array Without Losing The LIFO Order”
Adding or Subtracting a Date Time Variable in SQL Server Using DateAdd Function
28-05-2012 You can use dateadd function to add or subtract a number of units from any part (year, month, day, hour, minute, second, millisecond, etc…) of a datetime variable. Syntax: – DateAdd(Date Part, Number Of Units To Add, Source Date) Date Part : – Specify which part of the date you want to increment orContinue reading “Adding or Subtracting a Date Time Variable in SQL Server Using DateAdd Function”
What is Go in SQL Server and the Importance of Using Go
25-05-2012 Go is not a SQL or Transact SQL command. Go is a command recognized by sqlcmd and osql facilities provided by SQL server studio. Go specifies an end to a particular SQL batch. Once the parser interprets a Go, that block is considered completed and the following SQL are considered as new batch tillContinue reading “What is Go in SQL Server and the Importance of Using Go”
Importance Of Specifying Variable Length For Varchar in SQL Stored Procedures
23-05-2012 If you donβt specify a variable length for NVarchar, Varchar variables, the parser will assume the length of 1. It will not complain. Instead it will just truncate whatever you pass to the variable and use the first character. This mistake can cost you lots of time. Especially if you are working on aContinue reading “Importance Of Specifying Variable Length For Varchar in SQL Stored Procedures”
How To Temporarily Undo Or Turn Off Auto-Correct In Excel
22-05-2012 The auto correct feature can run you mad sometimes. For example, today I had to type EHR in Excel and it kept auto correcting it to HER π¦ I did a quick search and following are our options around this: Try Undo-ing (ctrl+z) – this works for earlier versions of excel but not forContinue reading “How To Temporarily Undo Or Turn Off Auto-Correct In Excel”