在SQL2000下运行程序出现的问题

[复制链接]
查看11 | 回复4 | 2009-8-11 16:40:48 | 显示全部楼层 |阅读模式
这样试一下:string constr="server=.;database=text;uid=sa;password=";
SqlConnection con = new SqlConnection(constr);
string cmdStr = "select daty,waterhigh,waterflow from zong_gk ";
SqlDataAdapter da = new SqlDataAdapter(cmdStr, con);//自动打开连接
DataTable dt = new DataTable();
da.Fill(dt);...
回复

使用道具 举报

千问 | 2009-8-11 16:40:48 | 显示全部楼层
string constr="server=;uid=sa;password=;database=text";你这个数据库连接语句有问题!server怎么可能为空呢?你得填写你访问的服务器啊。如果是本机就要写server=.;...
回复

使用道具 举报

千问 | 2009-8-11 16:40:48 | 显示全部楼层
SqlServer2005的配置有问题,你看看是不是配置的不允许别的计算机连到此数据库上把...
回复

使用道具 举报

千问 | 2009-8-11 16:40:48 | 显示全部楼层
数据库是text吗?server也要填写吧...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行