Connection String

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 3
Reputation: hamjad is an unknown quantity at this point 
Solved Threads: 0
hamjad hamjad is offline Offline
Newbie Poster

Connection String

 
0
  #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
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: Connection String

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

In the web.config
  1. <add name="SQLConnStr" connectionString="Data Source=SQLSERVER;Initial Catalog=DATABASE;uid=USERNAME;pwd=PASSWORD"/>
In the VB.NET Code
  1. System.Configuration.ConfigurationManager.ConnectionStrings("SQLConnStr").ConnectionString
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC