views:

510

answers:

0

Guys, I am going to use Enterprise Library (4.1) and especially DAAB. Here is I have questions:

  1. What is the best approach and why:

    • Every time when I need to run a DbCommand I create Database instance using DatabaseFactory.CreateDatabase();

    • I have a base class with instanced Database (using the same CreateDatabase() static method) and something like public property which returns the instanced database.

  2. How it is “heavy” or fast/slow to create an instance of Database class? What if I do it every time when a DbCommand is needed?

Thank you.