Csharp Code Samples

Rohan’s Blog – C# .NET Programming
  • rss
  • Home
  • About
  • Search
  • Contact Me

Efficient Server Side Paging Alternatives

Rohan Warang | April 20, 2009

Every one of us has used paging in our projects to display tabular data in DataGrids or GridViews or in the more recent and more flexible ListViews.

The problem we often face is when the data is less the paging works fine, but as the data starts to increase the page load times start increasing. The main reason for this is because we tend to bind the grids with entire data table and then use the built in functionality for paging.

This article describes how to effectively do server side paging by retrieving only a finite amount of data using the traditional stored procedure technique, but optimized for not being affected by volume of data, and an alternative method using the very famous linq framework.

Read the rest of this entry »

Comments
No Comments »
Categories
Optimization
Tags
Database, Linq, Linq to SQL, Paging, Stored Procedure
Comments rss Comments rss
Trackback Trackback

Thread Synchronization: Ensuring Atomic Operations

Rohan Warang | April 7, 2009

An atomic operation in computer science refers to a set of operations that can be combined so that they appear to the rest of the system to be a single operation with only two possible outcomes: success or failure (Wikipedia).

In a threaded application certain variables or objects may be shared by multiple threads. If these variables are accessed by two or more threads at the same time it will produce unpredictable results. These operations cannot be termed as atomic.

This article describes how to ensure atomic operations in a multi-threaded environment.

Read the rest of this entry »

Comments
2 Comments »
Categories
Tutorials
Tags
Atomic, Lock, Threading
Comments rss Comments rss
Trackback Trackback

Thread Synchronization: Avoiding Race Conditions

Rohan Warang | April 5, 2009

Race conditions occur when two or more threads try to gain control of the same object. In a threaded application multiple instances of threads run concurrently. These threads may share some variables such as counters or some other global objects. There is every chance that multiple threads simultaneously try to write values to the same object. This is known as a race condition.

Read the rest of this entry »

Comments
1 Comment »
Categories
Tutorials
Tags
Race Condition, Synchronization, Threading, Wait Handles
Comments rss Comments rss
Trackback Trackback

Asp.net Permalinks Using URL Rewriting

Rohan Warang | March 25, 2009

A Permalink is a permanent link which points to a particular blog entry or forum entry. For example the permalink for this blog article is http://csharp-codesamples.com/2009/03/aspnet-permalinks-using-url-rewriting.

This does not mean that a physical page is created for each blog entry. Instead a single page shows the data for multiple blogs articles dynamically based on some query string.

But all pages in asp.net end with a .aspx extension and if we pass a query string to the page it will look something like Page.aspx?query=test. These links are not very search engine friendly.

This article describes a simple method to create permalinks and improve your asp.net websites search engine optimization using URL rewriting without the use of custom handlers.

Read the rest of this entry »

Comments
2 Comments »
Categories
Tutorials
Tags
ASP.net, Blog, Permalinks, SEO, URL Remapping, URL Rewriting, Virtual Path
Comments rss Comments rss
Trackback Trackback

« Previous Entries Next Entries »

Subscribe

dZone

Categories

  • Optimization
  • Tutorials

Admin

  • Log in
Creative Commons License rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox