예제 #1
0
        protected void ButtonUpdateProdus_Click(object sender, EventArgs e)
        {
            string           id_produs = Request.QueryString["id_prod"];
            string           oradb     = "user id=badeavalentina;password=valentina;data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= 193.226.51.37)(PORT = 1521))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME=o11g)));";
            OracleConnection conn      = new OracleConnection(oradb); // C#

            conn.Open();
            string query_update = "update produs set stoc_curent = '" + stoc + "', stoc_impus = '" + stoc_impus + "', pret_unitar = '" + pret + "' where id_produs = '" + id_produs + "'";

            OracleCommand cmd = new OracleCommand();

            cmd.Connection  = conn;
            cmd.CommandText = query_update;
            cmd.CommandType = CommandType.Text;
            var trans = conn.BeginTransaction();

            cmd.ExecuteNonQuery();
            trans.Commit();
            conn.Close();
            string test = "test";

            LabelProdus.Visible       = true;
            DataListProdus.DataSource = InfoProdus();
            DataListProdus.DataBind();
            DataListProdus.Visible = true;
        }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         DataListProdus.DataSource = InfoProdus();
         DataListProdus.DataBind();
     }
 }