User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,861 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,624 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1315 | Replies: 1
Reply
Join Date: Sep 2007
Posts: 3
Reputation: hamjad is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
hamjad hamjad is offline Offline
Newbie Poster

Connection String

  #1  
Sep 21st, 2007
Hi Guys,
I am developing asp.net web application using vb.net ,I was wondering If there is a way to get the connection string value actually stored in web.xml file to be used in the vb.net code.
Any comment will be helpful
Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: England
Posts: 153
Reputation: ptaylor965 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: Connection String

  #2  
Sep 21st, 2007
To pull the SQL Connection String from the Web.Config use

In the web.config
<add name="SQLConnStr" connectionString="Data Source=SQLSERVER;Initial Catalog=DATABASE;uid=USERNAME;pwd=PASSWORD"/>

In the VB.NET Code
System.Configuration.ConfigurationManager.ConnectionStrings("SQLConnStr").ConnectionString
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 3:42 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC