????Default.aspx.cs
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender?? EventArgs e)
{
}
protected void BtnOK_Click(object sender?? EventArgs e)
{
string ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:DataBase Password=" + this.TxtMm.Text + ";User Id=admin;Data source=" + Server.MapPath("db_ADO.mdb");
OleDbConnection Con = new OleDbConnection(ConStr);
if (this.TxtMm.Text == "")
{
Response.Write("<script language=javascript>alert('????????????????');location='javascript:history.go(-1)'</script>");
}
else
{
try
{
//???????????
Con.Open();
OleDbDataAdapter Dap = new OleDbDataAdapter("select * from tb_booksell"?? Con);
DataSet ds = new DataSet();
Dap.Fill(ds?? "tb_booksell");
GridbookSell.DataSource = ds;
GridbookSell.DataBind();
this.lblMessage.Text = " ????????????Access?????????????";
}
catch (Exception error)
{
this.lblMessage.Text = " ????????????????????????????";
return;
}
finally
{
//????????????
Con.Close();
}
}
}
}