and so on. You can design a web page within this tag and you can see the outer layout for this page in design view itself. Now you can identify your piece of page development lies within the framework predefined using the Master page. Using this way of development, not only the rework efforts will be reduced but also the flexibility in web page design will be experienced by the developer.
III. ADO.Net:
DataSet and DataReader Transfer:
In .NET 2.0, you can directly load the DataReader into the Dataset or the Data Table and vice-versa. You have a new method “load” and using this you can load the DataReader into the DataSet or the DataTable. Like you also have another method called “getDataReader”which will return the DataReader back to the DataSet or the DataTable. DataTable is now having most of the methods of the DataSet. For example: WriteXML and ReadXML methods are now available for DataTable also.
Data Paging:
Custom Paging is one the major requirement in the ASP.NET. Earlier we used to write Stored Procedure to implement pagination logic. But in ADO.NET, you can do is very simply using the framework functionality itself. A new API "ExecutePageReader" in SQLCommand will do all the stuff for you and return only the required records. This method is very similar to ExecuteReader but it will accept two extra parameters. One is "Starting row number" and other one is for "number of rows". This will also return DataReader.
Ex:
Dim drEvents As SqlDataReader
Dim conn As New SqlConnection(Conn_str)
conn.Open()
Dim sqlc As New SqlCommand("Select * from tblEvents", conn)
drEvents =
sqlc.ExecutePageReader(CommandBehavior.CloseConnection, 10, 10)
BatchUpdates:
In previous versions of ADO.NET, if you do changes to DataSet and update using DataAdapter.update method. It makes round trips to datasource for each modified rows in DataSet. This is fine with few records, but if there is more than 100 records to be modified, then it will make 100 calls from DataAccess layer to DataBase which is not acceptable. In this release, MicroSoft have changed this behaiour by exposing one property called "UpdateBatchSize". Using this we can metion how we want to groups the rows in dataset for single hit to database.
For example if you want to group 50 records per hit, then you need to mention "UpdateBatchSize" as 50.
Conclusion:
In this document, I would like to share my experiences or views while working with the latest version of .NET 2.0. It make our lives more simpler than earlier by providing the direct functions like user.identity.name for getting the name of the person who logged into the system (provided the settings in IIS should support to Windows Authentication). As a developer, you can feel the difference right from the UI level to the database operations(ADO.Net) level.
Responses
|
| Author: ChandraShekar Thota 27 Nov 2007 | Member Level: Diamond Points : 0 |
gud article really useful for many people i used to see many people asking about new features in questions section this article might be very much useful
|