Hi all,
I have had a look around the forums but i could find anything, if someone could point me in the right direction for this.
What is the best way to handle an sql connection, in my program I have to get data from the server on a button click now my question is is it better to recreate the connection on every click and perform the query ie create a new SqlConnection every time, or is it better to create the connection once when the program starts up and just open and close it every time the push the button, ps the program has to run for a long time so I'm not so sure on the connection timing out.
Thanks
CrazyProgrammer 0 Light Poster
Momerath 1,327 Nearly a Senior Poster Featured Poster
CrazyProgrammer 0 Light Poster
gusano79 247 Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.