Recent Posts


Comments

LINQ to SQL and Case statement by vik20000in

Working with LINQ I realized that I had to use the simple case statement in my SQL query. There is no special keyword for this. To create a case statement like structure you will have to do it in the select section of the query. Below is an example of...
Filed under: , ,

Comments

Converting double to integer using cast and convert statement by vik20000in

Check out the code below. double d = 13.6; int i1 = Convert.ToInt32(d); int i2 = (int)d; if (i1 == i2) { Console.WriteLine("Equal"); } else { Console.WriteLine("Not Equal"); } The output of the above program would be “Not Equal”. The reasons being different...
Filed under: ,
1
Comments

Bankers Rounding in Math.Round Method by vik20000in

What would be the output of the following program? Console.Write(Math.Round(-0.5).ToString() + “~”); Console.Write(Math.Round(0.5).ToString()+ “~”); Console.Write(Math.Round(1.5).ToString()+ “~”); Console.Write(Math.Round(2.5).ToString()+ “~”); If you...
Filed under: , ,
1
Comments

Using Enviroment.FastFail method to exit the corrupt application Process by vik20000in

Have you ever had some point in code where you want to exit the application immediately? Normally for this purpose you would use the Application.Exit method. But Microsoft has provided a better method for this purpose which not only just exits the application...
Filed under: ,

Comments

Convert string to uppercase when comparing after normalizing instead of lowercase by vik20000in

While doing string comparison after normalizing (converting both string to upper case or lower case) we should always use the upper case. Upper case is optimized for normalization. A small group of characters, when they are converted to lowercase, cannot...
Filed under: ,

Comments

Finding Network statistics in Dot Net by vik20000in

Last few days while working with my broadband network (downloading few stuff) I wanted to check the exact amount of download per minute. I tried to check the data from task manager and resource monitor. But these gave data in terms of percentage of network...
Filed under: , ,

Comments

Community Tech days on 11th July in Kolkata by vik20000in

We are having community Tech day’s event in Kolkata on 11th of July 2010. Event will be held in Moksh Banquet Hall, Block-A, 22 Camac Street, Kolkata 700016. Click here to Register for this CTD Some of the key topics of discussion in the event and the...
1
Comments

All the posts in LINQ series by vik20000in

In Last few weeks I have done a few LINQ series Post. Here is a list of all the posts done. Filtering data in LINQ with the help of where clause Using Take and skip keyword to filter records in LINQ TakeWhile and SkipWhile method in LINQ LINQ and ordering...
Filed under: , ,
1
Comments

LINQ and Aggregate function by vik20000in

LINQ also provides with itself important aggregate function. Aggregate function are function that are applied over a sequence like and return only one value like Average, count, sum, Maximum etc… Below are some of the Aggregate functions provided with...
Filed under: , , ,
1
Comments

Working with Joins in LINQ by vik20000in

While working with data most of the time we have to work with relation between different lists of data. Many a times we want to fetch data from both the list at once. This requires us to make different kind of joins between the lists of data. LINQ support...
Filed under: , , ,
More Posts Next page »