日期:2014-05-16 浏览次数:20428 次
dbconn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\我的文档\Visual Studio 2005\Visualizers\WebSites\WebSite3\成绩单.mdb");
dbconn.Open();
da = new OleDbDataAdapter(@"SELECT xuesheng.Num_xuesheng, xuesheng.Name_xuesheng, kecheng.Name_kecheng, banji.Name_banji, xuanke.Chengji_xuanke, xuanke.Date_xuanke FROM (banji INNER JOIN ((xuesheng INNER JOIN xuanke ON xuesheng.Num_xuesheng = xuanke.XueshengNum_xuanke) INNER JOIN kecheng ON xuanke.KechengNum_xuanke = kecheng.Num_kecheng) ON banji.Num_banji = xuanke.BanjiNum_xuanke) " + tiaojian, dbconn);
DataSet di = new DataSet();
da.Fill(di);
GridView1.DataSource = di;
GridView1.DataBind();
dbconn.Close();
if(di.Tables[0].Rows.Count>0)//判断dataset数据集中的第一个datatable是否有行数据
{
//有数据
}