Remove StiDataSource before report loads
Posted: Wed Feb 16, 2011 8:37 pm
In my reports I programmatically add a datasource to an StiDatabase and some StiDataSource's when the report loads. Before I load the report, I want to remove the existing StiDatabase's and StiDataSource's that were saved with the report (I will then re-create them).
I am thinking of naming these programmatically added database and datasources with something like BUILTIN_xyz so I know which ones are "built-in" (anything starting with BUILTIN_) and which ones the user added (all others). I can iterate through the Dictionary.Databases.Items and remove any that start with BUILTIN_ ... but I cannot seem to be able to iterate through the DataSources and find any that were using a database named "BUILTIN_*". How can I tell what database a datasource is connected to?
thx
I am thinking of naming these programmatically added database and datasources with something like BUILTIN_xyz so I know which ones are "built-in" (anything starting with BUILTIN_) and which ones the user added (all others). I can iterate through the Dictionary.Databases.Items and remove any that start with BUILTIN_ ... but I cannot seem to be able to iterate through the DataSources and find any that were using a database named "BUILTIN_*". How can I tell what database a datasource is connected to?
thx