Showing posts with label READ CONNECTION STRING FROM WEB.CONFIG FILES. Show all posts
Showing posts with label READ CONNECTION STRING FROM WEB.CONFIG FILES. Show all posts

Sunday, 12 May 2013

HOW TO READ CONNECTION STRING FROM WEB.CONFIG FILES

HOW TO READ CONNECTION STRING  FROM WEB.CONFIG FILES ?


CONFIGURATION MANAGER IS USED TO READ CONNECTION STRING FROM WEB.CONFIG FILE.


For eg : 

 protected void Page_Load (...)          

 { con.ConnectionString = ConfigurationManager.ConnectionString["cn"].ConnectionString; //some code // }