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

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.