Microsoft.NET

……………………………………………….Expertise in .NET Technologies

What is New in ADO.NET 2.0

Posted by Ravi Varma Thumati on May 15, 2009

The following features are new in ADO.NET version 2.0.

Managed Providers

Server Enumeration

  • Provides support for enumerating active instances of Microsoft SQL Server 2000 and later.

Asynchronous Processing

  • Allows you to perform asynchronous database operations using an API that is modeled after the asynchronous model used by the .NET Framework.

Multiple Active Result Sets (MARS)

  • Allows an application to have more than one SqlDataReader open on a connection when each instance of SqlDataReader is started from a separate command.

Bulk Copy Operations

  • Enables you to perform fast bulk inserts using the .NET Data Provider for SQL Server.

New SQL Server Max Data Types

  • Provides support for varchar(max), nvarchar(max), varbinary(max) data types in SQL Server 2005.

SQL Server User-Defined Types

  • Provides support for user-defined data types (UDTs) in SQL Server 2005..

SQL Server Notifications

  • Allows .NET Framework applications to send a command to SQL Server and request that a notification be generated if executing the same command would produce result sets different from those initially retrieved.

Transactions with SQL Server Snapshot Isolation

  • Provides support for snapshot isolation, a SQL Server 2005 mechanism designed to reduce blocking in OLTP applications.

Database Mirroring in SQL Server 2005

  • Provides support for database mirroring in SQL Server 2005 with new connection string syntax for specifying a failover partner server.

Provider Statistics

  • Provides support for retrieving runtime statistics in SQL Server 2005. Currently 21 different counters are available from the .NET Provider for SQL Server..

Change Password in SQL Server 2005

  • Allows .NET Framework applications to change password of a user account without requiring administrator intervention.

Batch Processing

  • Enhances application performance by reducing the number of round-trips to the database when applying updates from the DataSet.

Tracing

  • ADO.NET 2.0 introduces new built-in data tracing functionality that is supported by the .NET data providers.

Partial Trust

  • All Microsoft data providers are now supported in partially trusted environments..

Connection Pooling Control

  • ADO.NET 2.0 introduces two new methods to clear the connection pool: ClearAllPools and ClearPool.

SQL Server XML Data Type Support

  • SQL Server 2005 has a new XML data type, and System.Data.SqlClient provides robust support for it on the client. The XML values are exposed using the System.Xml framework for seamless integration with the .NET programming model.

Integration with System.Transactions and Promotable Transactions Optimization for SQL Server 2005

  • .NET 2.0 includes a new transactions framework, accessible through the System.Transactions namespace. When combining System.Transactions for distributed transaction management, System.Data.SqlClient for database access, and SQL Server 2005 as the back end, it is possible to optimize distributed transactions so that the extra cost of making them “distributed” is only incurred when the transactions are actually needed.

Disconnected Classes

DataSet Enhancements

  • The new DataTableReader presents the contents of a DataSet or a DataTable in the form of one or more read-only, forward-only result sets.

DataSet Enhancements

  • A new index engine improves the performance of insert, delete, and modify operations to DataTable and DataRow objects. An index or primary key must be defined in the base table.

Binary Serialization for the DataSet

  • This new option enables a DataSet and a DataTable to be serialized in binary format when using binary transports over remoting. In most cases this will result great performance improvements and a noticeable reduction in both memory and CPU usage when using DataSet/DataTable objects in applications that use remoting to connect to different tiers.

DataTable as a Stand-Alone Object

  • Many methods that were only available in the DataSet in previous versions are now available in the DataTable as well (such as ReadXml and WriteXml). Also, a DataTable can be serialized by itself, so it’s no longer necessary to have a DataSet with a single table just to expose the table through Web services or any other mechanism that requires serialization.
  • Create a DataTable from a DataView

oYou can now create a DataTable from a DataView. The new DataTable will have the same set of rows as the current DataView. Optionally the columns of the new DataTable can be a subset of the DataView columns. The rows can be either all rows or only distinct rows.

  • Schema Inference Engine Enhancements

oThe schema inference engine has been enhanced to infer types when enough information is available; it is also significantly faster.

  • Namespace-Qualified Tables

oA DataSet can now support tables that have the same TableName but with a different Namespace, providing a mechanism to avoid naming conflicts.

  • New DataTable Loading Capabilities

oThe new Load method for DataTables and DataSets can stream a DataReader into a DataTable directly. The Load method also has new options for load behavior that extend the functionality available through the DataAdapter.

  • Row State Control

oThe new SetAdded and SetModified methods allow applications to explicitly manipulate the row state for DataSet and DataTable rows.

  • Enhanced Support for Custom Defined Types

oThe DataTable provides more support for custom, user-defined types. XML serialization has been extended to support polymorphism. For example, a Person Column can store an Employee instance that gets serialized and de-serialized to and from XML without loss of any type fidelity. Additionally users can now implement the new change tracking interfaces that enable the DataTable to track changes for such objects.

XML/XSD Enhancements

  • Added support for reading and writing simple types in XSD. Added support for reading and writing of multiple schemas to a stream. Added support for reading and writing of XSD/XML where a single table or XML Element is nested inside two or more parent tables.

DataRow Enhancements

  • The new IndexOf can be used to find position of row in DataTable.Rows collection.

Change Position of Column in DataTable

  • The new SetOrdinal method allows users to change the position of the column in a DataTable.

DataView Performance Improvements

  • The DataView in ADO.NET 2.0 uses a new update algorithm resulting in significant improvement in DataView maintenance.

DataColumn Expressions

  • An expression in a DataColumn can include columns from the same DataTable. The expression can be updated, and the column value is maintained.

Schema Serialization for Typed DataSet

  • Typed DataSets can skip the schema component from being serialized by setting the SchemaSerializationMode enumeration to ExcludeSchema.

Provider-Independent APIs

.NET Data Provider Enumeration

  • Provides support for enumerating installed data providers.

Provider Independent API

  • Enhancements to the System.Data.Common namespace provide access through a single API to databases across multiple providers.

Schema Discovery

  • Schema discovery allows applications to request managed providers to find and return information about the database schema of the database a given connection is connected to. Different database schema elements such as tables, columns and stored-procedures are exposed through the GetSchema methods of each provider’s Connection class.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: