Archives
-
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
-
All the posts in LINQ series
In Last few weeks I have done a few LINQ series Post. Here is a list of all the posts done.
-
LINQ and Aggregate function
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 LINQ and example of their implementation. -
Working with Joins in LINQ
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.
-
17 new features in Visual Studio 2010
Visual studio 2010 has been released to RTM a few days back. This release of Visual studio 2010 comes with a big number of improvements on many fronts. In this post I will try and point out some of the major improvements in Visual Studio 2010.
-
Using the StopWatch class to calculate the execution time of a block of code
-
LINQ and the use of Repeat and Range operator
LINQ is also very useful when it comes to generation of range or repetition of data. We can generate a range of data with the help of the range method.
-
Retrieving only the first record or record at a certain index in LINQ
While working with data it’s not always required that we fetch all the records. Many a times we only need to fetch the first record, or some records in some index, in the record set. With LINQ we can get the desired record very easily with the help of the provided element operators.
-
LINQ and conversion operators
LINQ has a habit of returning things as IEnumerable. But we have all been working with so many other format of lists like array ilist, dictionary etc that most of the time after having the result set we want to get them converted to one of our known format. For this reason LINQ has come up with helper method which can convert the result set in the desired format. Below is an example
-
Using set operation in LINQ
There are many set operation that are required to be performed while working with any kind of data. This can be done very easily with the help of LINQ methods available for this functionality. Below are some of the examples of the set operation with LINQ.
-
Grouping data in LINQ with the help of group keyword
While working with any kind of advanced query grouping is a very important factor. Grouping helps in executing special function like sum, max average etc to be performed on certain groups of data inside the date result set. Grouping is done with the help of the Group method. Below is an example of the basic group functionality.
-
LINQ and ordering of the result set
After filtering and retrieving the records most of the time (if not always) we have to sort the record in certain order. The sort order is very important for displaying records or major calculations. In LINQ for sorting data the order keyword is used.
-
TakeWhile and SkipWhile method in LINQ
-
Using Take and skip keyword to filter records in LINQ
In LINQ we can use the take keyword to filter out the number of records that we want to retrieve from the query. Let’s say we want to retrieve only the first 5 records for the list or array then we can use the following query
-
Filtering data in LINQ with the help of where clause
-
HTML Encoded Code Expression
Hi,
-
Changes in Asp.Net Request Validation
Hi,
When a page is submitted, users can also script along with the post data. Also unauthorized postback could be triggered. The event validation mechanism reduces the risk of unauthorized postback requests and callbacks when the EnableEventValidation property is set to true. This would help and provide default level of protection against cross site scripting. -
HtmlEncode and UrlEncode Now Encode Single Quotation Marks
Hi,
One of the small but important change in the Asp.Net 4.0 is the change is the Encode methods. Now the HtmlEncode and UrlEncode methods in the HttpUtility and HttpServerUtility class respectively also encode the single quote (‘). -
Who is your tomorrow's competitor
Who sells the largest number of cameras in India?
-
Visual Studio 2010 RC released for MSDN Subscriber
Hi,
-
Wrapping Text Line in a label control
Hi,
-
Difference is comparison when using equals method or Double Equal to operator
Hi,
-
Observer Design Pattern
Hi, -
Microsoft MVP for the year 2010
Hi,