Tuesday, 13 July 2010

What are the important points when developing a data access app with ADO.Net?


  • Always try to use the base interfaces for connection, command, data reader and other objects.
  • Always try to use the SqlClient, SqlServerCe and OracleClient to connect with the Sql Server, Sql Server CE and Oracle database servers as they are specialized and optimized for the specific database servers.
  • Still remember to reference the data provider specific objects (SqlConnection, OracleCommand) to reference with the base interface (IDbConnection, IDbCommand)
C# Version
 IDbConnection conn = new SqlConnection();  ...  IDbCommand cmd = new OracleCommand(); 

No comments:

Post a Comment