Solved

mvc model connectionstring c#

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

803 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