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: [...]
March 29, 2007
Categories: Net 2.0 . . Author: bimal4u . Comments: Leave a Comment
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
March 29, 2007
Categories: Sql server 2005 . . Author: bimal4u . Comments: Leave a Comment
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 [...]
March 29, 2007
Categories: Sql Server 2000, Sql server 2005 . . Author: bimal4u . Comments: Leave a Comment
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 [...]
March 29, 2007
Categories: .net 1.0 . . Author: bimal4u . Comments: Leave a Comment
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 [...]
March 29, 2007
Categories: C# 2.0 . . Author: bimal4u . Comments: Leave a Comment