How to store a Global Connection String?
|
|
|
Question / Problem
|
How to store a Global Connection String?
|
Solution
|
How to store a Global Connection String?
Global Connecton String can be stored in a web.Config .By Storing this Connection in Web.Cofig you can access this Connection String thorugh out your Application.
How to Crate a Web.Config file?
1) First create one Defalut.asp page
2) Next in Menus click on WebSite-àAdd NewItem a window will open.In window select 'Web Cinfiguration File' and give the name to Web Configuratin File and click Add Button.
When you click on Add Button your created web.config file can see in your Solution Explorer.
How to write a Connection string in Web.Config?
Open your Web.Config file (or) Double click on your web.config file.when it opens , some prewritten XML tags you can see as follows
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<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.
-->
<
Applies to |
|
Asp.Net 2.0
|
Rank It |
|