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?
LoginPage.jpg
Login-Class-Step-Through.jpg
Login-Class-Error.jpg
DAL-001.jpg
DAL-002.jpg
DAL-Util-Class.jpg
DataProvider-Class.jpg
LVL 2
CipherISAsked:
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.
0
CipherISAuthor Commented:
didn't work
0
käµfm³d 👽Commented:
Perhaps you could elaborate on what you did exactly?
0
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...?
0
CipherISAuthor Commented:
I resolved it.  I made the method a shared method and the variables a shared method

0

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.
0
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.