I've been looking at a way, other than changing the App.Config settings, of ensuring that all my tableadapters have the correct connection string. The assembly I am writing will be deployed as a COM dll through a VB application, and so changing the App.Config settings isn't really an option.

I found this useful sounding advice
Modifying the Accessibility of the TableAdapter and its Connection
The default accessibility of TableAdapters is public. You can restrict access to your TableAdapters from outside components by changing the Modifier property for the TableAdapter in the Dataset Designer.

Similarly, you can share the connection that a TableAdapter uses by changing the ConnectionModifier property of the TableAdapter in the Dataset Designer. By default, the connection modifier is set to Friend. It is a good practice to leave this modifier set to the default to prevent unknown objects from using your connection (and possibly your credentials) to access the database. on MSDN : TableAdapters in Visual Studio 2005.

So, I've created a new Helper class to set up the connections for all of these objects.

public class AdapterManager
private static SqlConnection GetConnection()
AppSettings MyApp = AppSettings.GetInstance();

SqlConnection myConnection = new SqlConnection(MyApp.ConnectionString);
return myConnection;

public static void SetPersonConnectionString(PersonTableAdapter ta)

ta.Connection = GetConnection();


then from within the _Load event of my form, I call


and this seems to work like a charm. I'm sure there are better ways of doing this. If you know of one, then please let me know.