Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
make a globle connection in web.config file and fetch data on a page of asp.net
Posted
Updated 5-Nov-11 1:08am

<connectionstrings>

<add name="myConn" connectionstring="uid=sa;pwd=111;server=122.188.10.10;database=ddd">


then call this connection like:-
public static string strcon = ConfigurationManager.ConnectionStrings["myConn"].ConnectionString.ToString();

then i think u know the rest
use strcon for your connection
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900