StrataFrame Forum

Default DataSourceKey on Adding Business Object

http://forum.strataframe.net/Topic13153.aspx

By Bill Cunnien - 12/22/2007

Is it possible to set a default DataSourceKey when a new business object is created?  I can add the key manually after it is created...just looking for the shortcut.

Thanks,
Bill

By Greg McGuffey - 12/24/2007

You typically set this at the BO level, rather than at the instance level. I.e. you set it on the properties window for the BO itself. Thus you only set it once for each BO and your done.



The only time you would set it at the instance (i.e. on the BO instance that is dropped on a form) is when you want to change the DataSourceKey, to use a different datasource temporarily.
By Bill Cunnien - 12/26/2007

Hey Greg,

Thanks for the response.  I'll just enter the string upon creation of the BO class.  No biggie.  I was just hoping for the lazy way, since I will have several scores of BOs to create by project completion. 

Bill

By Greg McGuffey - 12/26/2007

Also remember that the default datasource key is an empty string ("") which is also the default for BOs, so typically you don't have to enter anything. Of course, if you have a bunch of datasources then you will need to enter the non-default data source keys in the BOs.
By Bill Cunnien - 12/26/2007

Ya, that's kinda my issue...I have a gob of datasources to work with.  I was just hoping to be able to switch the default from an empty string to something else.  Nevertheless, all is good.  Smile

Thanks,
Bill