标题:帮忙改个代码!!!
取消只看楼主
ljl8853
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2008-6-18
 问题点数:0 回复次数:0 
帮忙改个代码!!!
命名空间“System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”(是缺少程序集引用吗?)
怎么解决
在vs2005中这段代码怎么改写
SqlConnection myconnection = new SqlConnection("Server=(Local);database=test;uid=sa;pwd=sa");
myconnection.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["AttDownConnectionString"].ConnectionString;
SqlCommand cmd1 = new SqlCommand();
= "select count(QuestionId) from tblQuestion where QuestionId=4";
cmd1.Connection = myconnection;
myconnection.Open();
int count = (int)cmd1.ExecuteScalar();
myconnection.Close();
lable2.Text = (cmd1.ExecuteScalar()).ToString();

[[it] 本帖最后由 ljl8853 于 2008-6-19 14:46 编辑 [/it]]

[[it] 本帖最后由 ljl8853 于 2008-6-19 14:52 编辑 [/it]]
搜索更多相关主题的帖子: 代码 
2008-06-19 10:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-219974-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.152338 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved