mvc model connectionstring c#

Seven price
Seven price used Ask the Experts™
on
string sqlConn = System.Configuration.ConfigurationManager.ConnectionStrings.Item["ConnectionString"].ToString();
            SqlConnection Conn = new SqlConnection(sqlConn);


error with Item asking am i missing user reference. reverted back to c# leaving vb
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Commented:
In C#, leave out Item, and just keep the brackets:

string sqlConn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

Open in new window

Seven priceFull Stack

Author

Commented:
tks and happy holidays.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial