Displaying Summary Information in the GridView’s Footer

protected void ProductsInCategory_RowDataBound
    (object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
      … <i>Increment the running totals</i> …
    }
    else if (e.Row.RowType == DataControlRowType.Footer)
    {
      // Determine the average UnitPrice
      decimal avgUnitPrice = _totalUnitPrice / (decimal) _totalNonNullUnitPriceCount;
      // Display the summary data in the appropriate cells
      e.Row.Cells[1].Text = “Avg.: ” + avgUnitPrice.ToString(“c”);
      e.Row.Cells[2].Text = “Total: [...]

Sql paging through large amounts of data

DECLARE @PageSize int
DECLARE @PageNumber int
DECLARE @iBeginRecord int
DECLARE @iEndRecord int
SET @PageNumber = 1
SET @PageSize = 20
SET @iBeginRecord= ((@PageNumber – 1) * @PageSize) ;
SET @iEndRecord = @iBeginRecord + @PageSize;
SELECT PriceRank, ProductName, UnitPrice
FROM(  SELECT ProductName, UnitPrice, ROW_NUMBER() OVER(ORDER BY UnitPrice DESC) AS PriceRank FROM Products )  AS ProductsWithRowNumber 
WHERE PriceRank > @iBeginRecord AND PriceRank <= @iEndRecord

what’s the maximum size varbinary in Sql Server ?

In Microsoft SQL Server 2000 and earlier versions, the varbinary data type had a maximum limit of 8,000 bytes. To store up to 2 GB of binary data the image data type needs to be used instead. With the addition of MAX in SQL Server 2005, however, the image data type has been deprecated. It’s [...]

What is the difference between a.Equals(b) and a == b?

Value Types:
For value types, “==” and Equals() works same way : Compare two objects by VALUE
Example:
int i = 5;
int k= 5;
i == k > True
i.Equals(k) > True

Reference Types:
For reference types, both works differently :
“==” compares reference – you can say identity of objects and returns true if and only if both references point to the [...]

How to build assembly for different modules ?

You can generate modules as output as shown following
csc /target:module firstmodule.cs
this will create “firstmodule.netmodule”
Note: creating modules are not supported in Visual studio environment.
Or
csc first.cs /out:secondmodule.netmodule /target:module secondmodule.cs
This will compile first.cs and create output file first.exe, as well as build secondmodule.cs and create module output file secondmodule.netmodule:
So like this, you can generate different modules for different [...]