How to get the current DB connection?

Hi

I would like to do a SELECT statement to my SQL server. And I don't want to recreate a connection again. I want to use the current one. But, how to get it?

Thanks.
LVL 1
Abdurahman AlmatrodiBusiness DevelopmentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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

BTosonCommented:
Hi,
Without seeing your code it will be near impossible to answer.
0
Abdurahman AlmatrodiBusiness DevelopmentAuthor Commented:
It is in the Application Settings
0
BTosonCommented:
Well where in your code do you open the connection to your database?
What method are you using to connect/interrogate it?
0
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Abdurahman AlmatrodiBusiness DevelopmentAuthor Commented:
I mean I did not write it. The connection wizard did.
0
BTosonCommented:
Well you must have the connection defined somewhere.
You can executre multiple queries using one connection but how you do it depends on what you are doing!
0
Abdurahman AlmatrodiBusiness DevelopmentAuthor Commented:
I did not write that. I run wizard for the first time and that is it. Later, I just create datasets only.
0
Abdurahman AlmatrodiBusiness DevelopmentAuthor Commented:
I found it. it can be found in:
Properties.Settings.Default.[The Name]  
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
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
C#

From novice to tech pro — start learning today.