Skip to content

Web.config file connection string in View

neel k

Asked May 28, 2015, 6:05 AM EDT2 answers
Share
LinkedInX
Hi,
 
I need to display web.config file connection string in View in mVC  5.
 
Thanks 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Manoj Bhoir
    +1
    Hi,
     
    Try this :
    Code
    @System.Configuration.ConfigurationManager
    .ConnectionStrings["connectionStringName"].ConnectionString;
     
    +1
  • 0
    http://www.mikesdotnetting.com/Article/234/creating-a-connection-string-and-working-with-sql-server-localdb http://www.asp.net/mvc/overview/getting-started/introduction/creating-a-connection-string
    0