能给我一个Aceesss数据库的例子吗?
包括 登录验证 数据库的连接 添加 修改 删除 显示 正在学习 谢谢!
protected void Button1_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=D:\\excel\\Book1.mdb;extended properties=excel 8.0";//连接
conn.Open();
string sql = "UPDATE book SET A='b' WHERE B = 'b'";//修改
OleDbCommand comm = new OleDbCommand(sql, conn);
comm.ExecuteNonQuery();
string sql2 = "select * from book";//查询
comm.CommandText = sql2;
OleDbDataReader dr = comm.ExecuteReader();
GridView1.DataSource = dr;//显示
GridView1.DataBind();
conn.Close();
}
删除类似吧