Thursday, January 3, 2008

GridView Paging and Sorting in ASP.NET 2.0 without SqlDataSource

When displaying large amounts of data it's often best to only display a portion of the data, allowing the user to step through the data ten or so records at a time. Additionally, the end user's experience can be enhanced if they are able to sort the data by one of the columns. Creating a pageable, bi-directional sortable DataGrid in ASP.NET 1.x was possible, but required creating two event handlers and writing, at minimum, a half dozen lines of code. The good news is that with ASP.NET 2.0 you can create a pageable, bi-directional sortable DataGrid without writing a single line of code!

View the following Link to See the Example of Gridview Paging and Sorting in ASP.NET 2.0 with SQLDataSource GridView Paging

or

The follwoing Shows how to do Paging and Sorting without SQLDataSource,

--> First Change the AllowPaging and AllowSorting Properties to True for GridView.

For Paging,

on Page_Load,

Dim sqlconn As New SqlConnection("data source=;database=;uid=;pwd=")
Dim da As New SqlDataAdapter("select login,firstname,lastname from users", sqlconn)
Dim ds As New DataSet
da.Fill(ds, "users")
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()

GridView Has an Event Called PageIndexChanging , in this Event Procedure Write the following code

GridView1.PageIndex = e.NewPageIndex

Friday, December 28, 2007

DOT NET Framework Architecture

The .Net framework consists of two main component one of them is .Net framework class library and another is CLR. The .Net framework class library common for all .Net language .We can use this to develop different application such as console applications, windows and Web Forms and Web Services.
The CLR do some of the important task such as load the IL code of program at runtime. Compile the IL code in native code execute and manage code enforce security and type safety helps in thread support .The code that run in CLR is called unmanaged code .There is an layer which allow both manage code and unmanaged code to interoperate with each other.
The CLR is combination of various components which provides the runtime environment and runtime services for our application .These components loads the IL code into runtime environment and runtime service for our applications.
These components provide multiple task such as type safety and also provide automatic memory management and also helps in threading too. These components also play a sensitive role in exception manager. Some of these components which is generally asked in interview questions are as follow:
  • Class loader: its helps in loading class at runtime.Security engine: as the name suggest its helps in security restrictions and enforces security.
  • Code manager: Its works is to manage the code during execution.
  • Type checker: Its helps CLR to do strict type checking.
  • COM Marshler: It helps. Net application for exchange data with the COM applications.
  • Exception Manager: It provides a method to handle the runtime exceptions.
  • Base class library support: it provides the type which is required at runtime
  • Garbage collector: Its performs the automatic memory management and treatment of objects.
  • MSIL: It converts MSIL to native code and then converts MSIL code into native code.