Solved

mvc model connectionstring c#

Posted on 2012-12-20
2
317 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 75

Accepted Solution

by:
käµfm³d   👽 earned 335 total points
ID: 38711820
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
ID: 38713009
tks and happy holidays.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with retrieving partial value from a column using VB.NET 4 41
how to read json value 2 30
Variable Event ? 3 22
Automated testing suggestions? 2 24
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

912 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

26 Experts available now in Live!

Get 1:1 Help Now