none
Dynamic Dataset Connectionstring RRS feed

  • Question

  • Dear Friends,

         I have created a typed dataset using VS 2005 PRO.  Is there a method/best practice to dynamically change a connectionstring on a dataset-wide basis at runtime?  The dataset and tables/table adapters are connected/bound to a connectionstring property found in the app.config.  I have many tables/table adapters so to create a new "ConnectionString" type property (in a partial class) for each one is not a feasible solution.  Is there a way to neatly implement it on a dataset-wide basis.  I tried adding a property to the base dataset class whereby I replace the Default settings of the connectionstring in my app.config, but no success thusfar.  Any help is greatly appreciated.  In addition, my Dataset is stored in a VB.NET Class Library project as it is being used by multiple projects, therefore I am sure I will have issues with the app.config down the line.  Any ideas on that aspect?

         Regards,

              Giovanni

    Wednesday, November 1, 2006 3:45 PM