How to add additional properties to a database instance?

Topics: Data Access Application Block
Aug 29, 2007 at 11:16 PM
I want to add some properties to a database instance created using DatabaseFactory.CreateDatabase(). How can I accomplish this?
Aug 30, 2007 at 1:39 PM
Hi,

What kind of properties do you want to add? Can't they be specified in the connection string?

Fernando
Aug 30, 2007 at 6:26 PM
Hi Fernando,

Let's say that I want to save the initial database size of a database instance in a property of the database instance.
I wonder whether it is possible to add properties/methods to the database instance.


Peter


Aug 30, 2007 at 7:06 PM
Hi,

The Database object is a logical, client-side view of an existing database, determined by a connection string. You won't be able to modify the physical database settings with it, unless of course you issue the commands appropriate for the specific database engine.

Fernando
Aug 30, 2007 at 8:39 PM
Hi Fernando,

I'm not trying to modify the physical database settings. I'm trying to add additional properties to the database class (I guess I should use the term class) so the instance/object will have the additional properties too. I don't think I can add properties to an instance/object.


Peter
Aug 30, 2007 at 9:25 PM
Hi,

You will need to change the source and recompile to add new properties to the class. You can also create a new subclass, but since Database is already root of a hierarchy it's probably not the best thing to do.

Fernando