2
Answers

Share a SQL DB connection in the same form

M T

M T

16y
1.9k
1

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)