C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Passing connection string to web.config


Posted Date: 06 Aug 2007      Total Responses: 1

Posted By: PRASHANT SARWDAE       Member Level: Bronze     Points: 2


passing connection string to web.config file in runtime(as it read from ini file) and Accessing that connection string in the application
using
SqlConnection StrCon = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["con"])

or is there any alterantive to read the ini file once and pass it to the appln.

Thanks in advance




Responses

Author: Surbhi Aggarwal    06 Aug 2007Member Level: BronzeRating:     Points: 2
<configuration>
<appSettings>
<add key="pconn" value="Provider=MSDAORA.1;Data Source=orcl;User ID=dtp;Password=dtp"/>
</appSettings>

<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>


Post Reply
You must Sign In to post a response.
Next : why javascript not allow by Internet explorer and safari ?
Previous : HORIZONTAL MENU SELECTION IN ASP.NET
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use