Browse by Tags

All Tags » C# (RSS)

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: , ,

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: , ,

Observer Design Pattern by vik20000in

Hi, Many times when programming we come across situation where by change in one change needs to be updated in multiple object. For example if a parameter is used to make multiple calculation in different objects then on change of that parameter all the...
Filed under: , , ,

Visual Studio 2010 Beta 2 announced with Go Live License by vik20000in

Hi, Microsoft has announced the release of the Beta 2 of the Visual Studio 2010. MSDN Subscribers can download the same today and this will be available for the general Public of Wednesday. The link for download is http://msdn.microsoft.com/hi-in/vstudio...
Filed under: , , ,

How to simulate IN Clause in LINQ queries by vik20000in

Hi, When working with the LINQ queries for SQL one of the common queries that we need to run is the select query with IN clause. In SQL IN clause is used to provide more than one value to match in the where clause. Something like the query below Select...
Filed under: , , ,

Path.combine to combine two paths and backslash in second parameter by vik20000in

Hi, system.IO.Path comes with many good function to work with the File system. some of them are ChangeExtension, GetDirectoryName, GetExtension, GetFileNameWithoutExtension, IsPathRooted etc. The system.IO.Path.Combine is also include as a function in...
Filed under: , ,

Features and Improvement in Base class libraries in Dot net framework 4.0 by vik20000in

Hi, Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in...

C Sharp goto statement for breaking the nested loop by vik20000in

Hi, Two days back, while discussing with a friend came a small interesting (programming) situation where he wanted to stop (break) a loop which was inside another loop. You can think of the situation as he was first looping through all the rows in a grid...
Filed under: , , , ,

Yield keyword in C Sharp by vik20000in

Hi, One of the cool and yet most unknown feature of the C# is the yield keyword. The yield keyword is used in an iterator block to provide a value to the enumerator object or to signal the end of the iteration. When used the expression is evaluated and...
Filed under: ,
More Posts