G
Guest
I have typed DataSets in a data access tier and want to pass a connection
string from the client at run time (for use by the TableAdapters created
using VS2005). However, at design time, VS2005 sets the connection string as
a property (i.e., serialized to app.config).
This is ok for design time, but at run time, I need to pass the connection
string from the client. Also, I don't want an app.config in my data layer,
and the property that VS creates is read-only, so I don't see a natural way
to set this at run time.
Setting a single static property (similar to what VS does with the
app.config setting) seems like a fine way to keep the connection string, but
I'd like to be able to configure the DataSet (TableAdapters) to use a public
static property that I create instead of forcing me to use app.config.
Am I missing something? Is there a good way to handle this without mucking
around with the code that VS generates for the typed dataset?
string from the client at run time (for use by the TableAdapters created
using VS2005). However, at design time, VS2005 sets the connection string as
a property (i.e., serialized to app.config).
This is ok for design time, but at run time, I need to pass the connection
string from the client. Also, I don't want an app.config in my data layer,
and the property that VS creates is read-only, so I don't see a natural way
to set this at run time.
Setting a single static property (similar to what VS does with the
app.config setting) seems like a fine way to keep the connection string, but
I'd like to be able to configure the DataSet (TableAdapters) to use a public
static property that I create instead of forcing me to use app.config.
Am I missing something? Is there a good way to handle this without mucking
around with the code that VS generates for the typed dataset?