Situation:
1) We have heavy applications (>500 classes and many frontend forms)
2) We have to work with DataAdapter Wizard cause of the prodictivity
3) DataAdapter is making/getting connection from DB Explorer
4) We have Dev and Prod versions (with different DB)
WHY is it not easy to change all Connection strings (without
recompiling!) ?
1) You can set a mapping to appSettings (that is bullshit cause you
have to provide username and password) and the mapping is NOT working
with section handlers (i dont know why this is not working - should be
easy)
2) You can Implement your own DataAdapter (inherited) and set the
Command.Connection.ConnectionString properties with DesignerHost etc.
(that is bullshit cause some "stupid" developer will forget to set
from dev to prod or vice versa)
3) You dont work with Wizards (that may be the best solution cause
DataAdapter can't work well with several tables and if you work with
long namespaces and want to select a DataSet you can't see the ful
namespace HAHA try it and you will find it) - so you lose your visual
design etc.
Oh dear, we live in a practical world with large business applications
and 100's of classes in a project.
Now best solution seems to be to go through all controls and set the
connection string to a static class in a templated manner to all
subcontrols who are of iType IDbConnection.
This works fine BUT are there some ideas how to implement a easy
switch from dev to product and vice versa? This must be an "one click"
solution cuz every large project will need this ???
Zorn - born to kill the bad designed systems
|