0 Replies - 1195 Views - Last Post: 01 November 2007 - 10:56 AM

#1 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Accessing web.config connection strings with VB

Posted 01 November 2007 - 10:56 AM

Description: Use this piece of code to store the connection string "MainConnStr" into the variable "connStr".The snippet will let you retrieve your connection string(or strings) from your web.config file(instead of putting them into each one of your scripts). I found it at http://weblogs.asp.n...P.NET-v2.0.aspx
Dim connStr As String = ConfigurationManager.ConnectionStrings("MainConnStr").ConnectionString


Is This A Good Question/Topic? 0
  • +

Replies To: Accessing web.config connection strings with VB

#2 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Accessing web.config connection strings with VB

Posted 01 November 2007 - 10:56 AM

Description: Use this piece of code to store the connection string "MainConnStr" into the variable "connStr".The snippet will let you retrieve your connection string(or strings) from your web.config file(instead of putting them into each one of your scripts). I found it at http://weblogs.asp.n...P.NET-v2.0.aspx
Dim connStr As String = ConfigurationManager.ConnectionStrings("MainConnStr").ConnectionString

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1