核心代码: 登陆代码: protected void Button1_Click(object sender, EventArgs e) { string name = TextBox1
Trim(); string psw = TextBox2
Trim(); OleDbConnection conn = new OleDbConnection(); conn
ConnectionString = @"Provider=Microsoft
0;Data Source=E:\专业知识学习\ASP
NET\学生管理系统\students
mdb"; conn
Open(); OleDbCommand cmd = new OleDbCommand(); cmd
Connection = conn; int i = DropDownList1
SelectedIndex; string sql=""; switch(i) { case 0: sql="select * from student"; break; case 1: sql="select * from teacher"; break; case 2: sql="select * from menager"; break; } cmd
CommandType = CommandType
Text; cmd
CommandText = sql; OleDbDataReader dr = cmd
ExecuteReader(); while (dr
Read()) { if (dr[0]
ToString() == name && dr[3]
ToString()==psw) { this
Session
Add("id", dr[0]); this
Session
Add("u