请教个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];
代码应该没错吧,可是输入条件后点击查询直接无反应地退出了测试,好像是数据库哪里出错了,请问有那位知道是什么原因吗?