//连接数据库开始
OleDbConnection Connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Request.PhysicalApplicationPath + ConfigurationManager.ConnectionStrings["ConnectionString"]);
//连接数据库结束
OleDbCommand Command = new OleDbCommand();
Command.Connection = Connection;
Command.CommandText = "select ClassName from aClass";
Connection.Open();
OleDbDataReader DataReader = Command.ExecuteReader();
ClassDrop.DataSource = DataReader;
ClassDrop.DataBind();
DataReader.Close();
Connection.Dispose();
Command.Dispose();