62,254
社区成员
发帖
与我相关
我的任务
分享
protected void Button2_Click(object sender, EventArgs e)
{
this.Panel1.Visible = false;
this.Panel2.Visible = true;
string connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/db.mdb ");
OleDbConnection myConn = new OleDbConnection(connstr);
string sql = "select * from [part] where [PartNumber]='" + PartNumber + "' and [PartGroup]='" + PartGroup + "'";
OleDbCommand myOleDbCommand = new OleDbCommand(sql, myConn);
myConn.Open();
OleDbDataReader reader = cmd.ExecuteReader();
string DisPartNumber = "";
string DisPartGroup = "";
string DisResponsibleAE = "";
while (reader.Read())
{
DisPartNumber = reader[1].ToString();
DisPartGroup = reader[2].ToString();
DisResponsibleAE = reader[3].ToString();
}
reader.Close();
conn.Close();
//关闭连接对象
myConn.Close();
this.TextBox1.Text = DisPartNumber;
this.TextBox4.Text = DisPartGroup;
this.TextBox15.Text = DisResponsibleAE;
}