Vikram Lakhotia
The Online Weblog of Vikram Lakhotia
-
Microsoft MVP for the year 2011
It’s been three year in a row now. I am MVP for the year 2011 also. It feels so great to get the news that I have been MVP again.
-
Inserting 40,000 records in MYSQL from Asp.Net
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 time consuming. More over this event would take place regularly and over 200 times a day and also user need to process the data after it has been uploaded.
-
Major Asp.Net security issue found - Temporary workaround provided
An attacker of this vulnerability can use it and download file like web.config which contains sensitive data about the application including connection string for database etc.
-
LINQ to SQL and Case statement
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.
-
Converting double to integer using cast and convert statement
Check out the code below.
-
Bankers Rounding in Math.Round Method
What would be the output of the following program? -
Using Enviroment.FastFail method to exit the corrupt application Process
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 but also adds a message to the Windows Application event log.
-
Convert string to uppercase when comparing after normalizing instead of lowercase
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.
-
Finding Network statistics in Dot Net
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 use. Hence I could never find the exact amount of download.
-
Community Tech days on 11th July in Kolkata