first_page

ADO.NET 2.0 Technology Strategy

People can write entire books based on the bullet points posted here. The intent is to summarize my ADO.NET 2.0 technology strategy for the near term:

  • Use System.Data.Common before any other System.Data types. This guidance is only possible with the release of ADO.NET 2.0. I rambled on in an earlier post about this should have been ‘eagerly’ awaited in the netcasting world.
  • Use System.Nullable types before resorting to provider types like those, say, in the System.Data.SqlTypes namespace. I wrote a helper class featuring the new TryParse() methods of types like DateTime, Boolean, Byte, etc.
  • Consider using multiple SELECT statements for one DbCommand and DbCommand.NextResult() before considering DBMS-level temporary tables.
  • Consider using DbTransaction and DbDataReader before considering DBMS-level transactions and cursors. Juval Lowry will call your application a “toy” because you don’t use transactions.The obligatory table of selected resources:
“[ADO.NET 2.0 Feature Matrix](http://msdn.microsoft.com/data/default.aspx?pull=/library/en-us/dnvs05/html/ado2featurematrix.asp)” “ADO.NET 2.0 includes a new base-class provider model, features for all providers, and changes to System.Data.SqlClient. Get an overview of these new features, examples of their use, and a chart of which features are provider-neutral and SqlClient-specific.”
“[Implementing a Provider Independent Data Access Layer in .NET](http://www.codeproject.com/vb/net/data_access_layer.asp)” “Now, what if the decision of selecting a provider is taken as late as application runtime? How should the data access layer (let’s call it DAL) be implemented so that applications that use the DAL be unaware of the provider being used and still work seamlessly with the DAL? This article deals with the design and implementation of the DAL which answers the above questions.”
“[Provider-Independent code simplified in ADO.NET 2.0](http://www.codeproject.com/useritems/ProviderIndependentCode.asp?df=100&forumid=338509&exp=0&select=1667156)” “This article will attempt to explain and demonstrate how Microsoft has simplified the approach to writing provider-independent code. Switching between Oracle, SQL, or any Oledb or Odbc data source is now as easy as changing a configuration setting.”
“[Generic Coding with the ADO.NET 2.0 Base Classes and Factories](http://msdn.microsoft.com/data/default.aspx?pull=/library/en-us/dnvs05/html/vsgenerics.asp)” “In addition to these ‘main’ base classes, many new base classes were added in ADO.NET 2.0, including some that we’ll be talking about later in this article. The provider base classes in ADO.NET are abstract, however, meaning that they can’t be instantiated directly.”
“[Create Provider-Independent Data Access Code with ADO.NET 2.0](http://www.codeguru.com/csharp/.net/net_data/sortinganditerating/article.php/c10487/)” “ADO.NET 2.0 introduces a myriad of new base classes in the new System.Data.Common namespace. These classes are specifically focused on enabling the creation of provider-independent data access code. They are abstract, so they can’t be instantiated directly.”
“[Working with a DbDataAdapter](http://msdn2.microsoft.com/en-us/library/fks3666w.aspx)” “The CreateDataAdapter method of a DbProviderFactory object gives you a DbDataAdapter object that is strongly typed to the underlying data provider specified at the time you create the factory. You can then use a DbCommandBuilder to create commands to insert, update, and delete data from a DataSet to a data source.”
“[The Baker’s Dozen: 13 Productivity Tips for ADO.NET 2.0](http://www.code-magazine.com/articleprint.aspx?quickid=0601031&printmode=true)” “ADO.NET has a rich object model, but takes time and experience to master, especially when coming from other development environments.”
“[FIX: SQL Server 2005 system performance may be slow when you use a keyset-driven cursor to execute a FETCH statement](http://support.microsoft.com/default.aspx?scid=kb;en-us;917738&sd=rss&spid=2855)” Issues surrounding this fix should lead one to *stop* using cursors! I tried this fix and saw no improvement.
“[Unit Testing the Data Access Layer](http://aspnet.4guysfromrolla.com/articles/040605-1.aspx)” With an ADO.NET 2.0 implementation strategy there needs to be a testing strategy. Right?

rasx()