2
Reply

Share a SQL DB connection in the same form

M T

M T

Apr 11 2008 12:27 PM
1.9k

Hi

I have been working in VB.NEt and recently shifted to C#. I want to open a DB connection and keep it open till user close the form. I want to use this connection for fetching different  record sets.

In VB, I can declare a CONN variable in teh beginig of the form and open the connection at the form load and keep on using it.

Is there a way in C#?

 

Thanks

 

 

 


Answers (2)