ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

 

Code Snippets

  

ASP Source Code


Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 300,464 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,688 people online right now. Registration is fast and FREE... Join Now!





Accessing web.config connection strings with VB

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.net/owscott/archive/2005/08/26/Using-connection-strings-from-web.config-in-ASP.NET-v2.0.aspx

Submitted By: girasquid
Actions:
Rating:
Views: 1,407

Language: ASP

Last Modified: December 31, 1969
Instructions: Use this piece of code to store the connection string "MainConnStr" into the variable "connStr".

Snippet


  1. Dim connStr As String = ConfigurationManager.ConnectionStrings("MainConnStr").ConnectionString

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month