日期: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 xuehao from xuanke", dbconn); respon.write(????);
select Max(xuehao) as xuehao from xuanke 这样写SQL语句就可以 然后 da = new OleDbDataAdapter(@" select Max(xuehao) as xuehao from xuanke", dbconn); DataTable dt = new DataTable(); da.Fill(dt); Response.write("最大学号为:"+dt.Rows[0]["xuehao"].ToString());
select Max(xuehao) as xuehao from xuanke
da = new OleDbDataAdapter(@" select Max(xuehao) as xuehao from xuanke", dbconn); DataTable dt = new DataTable(); da.Fill(dt); Response.write("最大学号为:"+dt.Rows[0]["xuehao"].ToString());