| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 441 人关注过本帖
标题:请教个C#问题
取消只看楼主 加入收藏
a3755866
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-12-18
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
请教个C#问题
我用C#写了个查询ACCESS数据表条件并且显示在DataGridView上,如:
string strsql;
            string conditon = "";
            DataAccess data = new DataAccess();
            DataSet ds;
            if (txtbanbie.Text != "")
            {
                conditon += "and Class='" + txtbanbie.Text + "'";
            }
            strsql = "select distinct Studentinfo.Class as 班别,Studentinfo.Sid as 学号,Studentinfo.Sname as 姓名,Classinfo.Sum as 总分,Classinfo.Avg as 平均分 from Studentinfo,Classinfo" + conditon;
            data.dataCon();
            ds = data.getDataSet(strsql);
            dgv2.DataSource = ds.Tables[0];
代码应该没错吧,可是输入条件后点击查询直接无反应地退出了测试,好像是数据库哪里出错了,请问有那位知道是什么原因吗?
搜索更多相关主题的帖子: 姓名 数据表 
2011-12-18 15:27
快速回复:请教个C#问题
数据加载中...
 
   



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

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