954,219 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Connection String

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

hamjad
Newbie Poster
3 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

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
ptaylor965
Junior Poster
170 posts since Oct 2006
Reputation Points: 16
Solved Threads: 19
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You