Home All Groups Group Topic Archive Search About

How to modify connection string at runtime for strongly typed data

Author
18 May 2006 5:59 PM
BabuMan
Hi,

I have been struggling for the past couple of days with this problem and I
don't know how to go about fixing it.  I hope somebody can help.

I have a Windows application (C#) where I have a few datasets holding quite
a number of tables.  These datasets were created visually by drag and drop
and the process created as many TableAdapters as there are tables.  These
datasets are in their own VS 2005 project for reuseability purpose.  My Main
Win application has properties setup including sql connections strings.  All
are fine for design time and testing.  But at runtime, I need to modify the
connection string based on the user, environment etc.  I need to make this
strongly typed autogenerated dataset to receive a custom connection string
(which also need to be created at runtime) from my Application.

Is there some sample code out there (preferably in C#) to achieve this? I
have seen a few posts and blogs that suggest some solutions. But they don't
seem to work for me.

Babu.

--
BabuMan

AddThis Social Bookmark Button