名称“ConfigurationManager”在当前的背景下不存在.......? [英] The name "ConfigurationManager" does not exist in current context.......?

查看:136
本文介绍了名称“ConfigurationManager”在当前的背景下不存在.......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在vs2o12中尝试这行代码时



In vs2o12 when trying this line of code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Configuration;
using System.Data;
using System.Data.SqlClient;










string connString = ConfigurationManager.ConnectionStrings["MyConnectionStringName"].ConnectionString;







我收到错误

[当前上下文中不存在名称ConfigurationManager....... ??]




有人可以帮忙吗?




Iam getting the error
[The name "ConfigurationManager" does not exist in current context.......??]
.

Could anyone please help?

推荐答案

经常使用Google,找到如下链接: http://stackoverflow.com/a/1836938 [ ^ ]
Use Google often, to find links like : http://stackoverflow.com/a/1836938[^]


你好



你需要一个对System.Configuration的引用
Hello

You need a reference to System.Configuration


检查此链接 [ ^ ]



检查此链接 [ ^ ]


这篇关于名称“ConfigurationManager”在当前的背景下不存在.......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆