Browse by Tags

All Tags » .NET (RSS)

Inserting 40,000 records in MYSQL from Asp.Net by vik20000in

Recently I got a task of importing about 40,000 records for a fixed length delimited file to MY SQL database. Copying the data into a list of Business object was not a problem, but to insert about 40000 records in MYSQL in an asp.net application looked...
Filed under: , , ,

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

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

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

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

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

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...

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

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

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 »