Quantcast
Channel: DataSource Controls - SqlDataSource, ObjectDataSource, etc.
Viewing all articles
Browse latest Browse all 956

Share SQL connection for all Subs

$
0
0

is it ok to put it on top of code page and share the sql connection for all subs?

Shared SQLCS As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("ABCConnectionString").ConnectionString)

it seems not good to type it again and again in a same code page.

Any use if different sql connection names are defined for different Subs?  Just for clarification?

Thanks a lot for your advice. 


Viewing all articles
Browse latest Browse all 956

Trending Articles