0

I have three connection strings in my config file. I want to detect the name of the connection string which is connected at the moment.

(All three databases are remote and have different purposes).

I want to detect the name at different places in my project.

Is it possible?

1 Answer 1

1

Here is the doc for OleDBConnection : https://msdn.microsoft.com/en-us/library/system.data.oledb.oledbconnection%28v=vs.110%29.aspx

Use the property ConnectionString of that object to know which connection is used.

But if you have three different databases for different purpose, I would suggest to use three Connection objects...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.