Solved

mvc model connectionstring c#

Posted on 2012-12-20
2
315 Views
Last Modified: 2012-12-21
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
0
Comment
Question by:sevensnake77
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 335 total points
Comment Utility
In C#, leave out Item, and just keep the brackets:

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

Open in new window

0
 
LVL 9

Author Closing Comment

by:sevensnake77
Comment Utility
tks and happy holidays.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now