943,985 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2940
  • ASP.NET RSS
Sep 21st, 2007
0

Connection String

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hamjad is offline Offline
3 posts
since Sep 2007
Sep 21st, 2007
0

Re: Connection String

To pull the SQL Connection String from the Web.Config use

In the web.config
ASP.NET Syntax (Toggle Plain Text)
  1. <add name="SQLConnStr" connectionString="Data Source=SQLSERVER;Initial Catalog=DATABASE;uid=USERNAME;pwd=PASSWORD"/>
In the VB.NET Code
ASP.NET Syntax (Toggle Plain Text)
  1. System.Configuration.ConfigurationManager.ConnectionStrings("SQLConnStr").ConnectionString
Reputation Points: 16
Solved Threads: 19
Junior Poster
ptaylor965 is offline Offline
169 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: ControlParameter DropDownList not recognized on a ObjectDataSource
Next Thread in ASP.NET Forum Timeline: Comment tag ASP.NET





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC