Changing a connection string for a TableAdapter

"Stephen G. Maczko" <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <!&!AAAAAAAAAAAYAAAAAAAAALpmdZsn0nJFlI2G65bJ3KnCgAAAEAAAAJ/[email protected]>
I have the following code:

    Public Function GetClerkshipEnvironmentByID(ByVal nID As Integer) As
CLSClerks2005.DAL.ApplicationProcedureViewDataSet.dalsp_ApplicProcViewDataTa
ble

        'Dim oConn As String =
System.Configuration.ConfigurationManager.ConnectionStrings.Item("ClsSurveyI
nstance").ConnectionString
        Dim oConn As String =
System.Configuration.ConfigurationManager.ConnectionStrings.Item("ClsClerksI
nstance").ConnectionString
        Me.Adapter.Connection.ConnectionString = oConn
        Return Me.Adapter.GetData(nID)
    End Function

Actually I'm trying to generate an error--the database that the
"ClsClerksInstance" points to is the wrong instance! But I still get the
page to display the data coming out of this TableAdapter. If that means I
can't change the connections string in this way, then can anybody suggest
how it's done?

Steve

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.