Tuesday, November 30, 2004

ADO.Net 2.0 and enhancements

ADO.Net 2.0 and enhancements

The article compares ADO.Net 2.0 with 1.1 and lists down the enhancements for DataSet, DataTable and DataView classes.

Here are some of the new features in ADO.NET 2.0

  1. There has been a lot of performance
    improvement working with DataSet in 2.0.

  2. Now one can serialize a DataSet into
    binary data using
    ds.RemotingFormat
    = SerializationFormat.Binary

  3. DataTable now supports ReadXML,
    ReadXMLSchema, WriteXML and WriteXMLSchema methods.

  4. DataTable also includes 2 new methods
    GetDataReader and Load. GetDataReader returns a DataTableReader which can
    be used to iterate throw the rows just like SQLDataReader.

  5. Load method loads the table with
    specified IDataReader parameter. The second parameter is LoadOption enum (OverwriteRow,
    PreserveCurrentValues and UpdateCurrentValues). The article explains the
    differece between these in an easy to understand way.

  6. DataView has a new method ToTable()
    which returns DataTable object created out of the DataView.