Aman Jen

Aman Jen

  • NA
  • 141
  • 39.5k

Web.config File And Connection string

Jul 30 2013 1:33 AM
Hi,
    Is it possible to connection string declared in web config file and use in subpages of Master Page once it defined  in master page....because I dont want to declare it again and again in sub pages because that again the same thing like declaring connection string locally like below on every subpage of Master Page

Public connStr As String = ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString
    Public cn As New SqlConnection(connStr)
    Public cmd As New SqlCommand


...plz help..



I Hope i am clear with my query

Answers (6)