bafflebox.aspx.cs
上传用户:vtryaojia
上传日期:2020-04-18
资源大小:1214k
文件大小:1k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.OleDb;
  12. public partial class bafflebox : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.     }
  17.     protected void Button1_Click(object sender, EventArgs e)
  18.     {
  19.         string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
  20.         OleDbConnection conn = new OleDbConnection(strConnection);
  21.         conn.Open();
  22.         OleDbCommand cmd1 = new OleDbCommand("insert   into   SpKd (ID,GoodsName,ClassName,MarktePrice) values('" + Session ["GWC_ID"] + "','" + DetailsView1.Rows[1].Cells[1].Text + "','" + "音响" + "','" + DetailsView1.Rows[2].Cells[1].Text + "')", conn);
  23.         cmd1.ExecuteNonQuery();
  24.         conn.Close();
  25.         Session["GWC_ID"] = Convert.ToInt32(Session["GWC_ID"]) + 1;
  26.         Response.Redirect("Default.aspx");
  27.     }
  28. }