Programmatically Change Connection String in Data Access Layer

I'm providing snapshots - hopefully it will help.  I have picked up an application from another developer.  The connection string was put in the DAL.  I have a requirement to change the connection string per HIPPA laws.  There are two connection strings in the webconfig file.

To make it easy - when the user logs in the first connection string needs to be used and passed to the DAL.  After login I need to pass the second connection string to the DAL and use it.

I put a breakpoint in the DAL.Setup but it does not stop and I receive an error in the Login Class.

Any idea?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
You've got a private variable _connstr which holds the connection string, why not create a public function that would allow you to pass in a new connection string? Perhaps:

Public Sub SetConnectionString(ByVal newConString As String)
    Me._connstr = newConString
End Sub

Open in new window

You call this as needed in the code outside of your DAL.
CipherISAuthor Commented:
didn't work
käµfm³d 👽Commented:
Perhaps you could elaborate on what you did exactly?
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

nishant joshiTechnology Development ConsultantCommented:
DAL ???  is it table adapter...?
CipherISAuthor Commented:
I resolved it.  I made the method a shared method and the variables a shared method


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CipherISAuthor Commented:
I resolved it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.