Exemple #1
0
        private void button8_Click_2(object sender, EventArgs e)
        {
            string          loot       = textBox6.Text;
            string          sbdsb      = comboBox6.Text;
            string          did        = label18.Text;
            string          sql_update = "UPDATE tblSBDispatch SET LotNo='" + loot + "', SBDSB='" + sbdsb + "',EID='" + textBox1.Text + "',isByHand=" + comboBox1.SelectedIndex + " WHERE DID=" + eid;
            OleDbConnection conn;
            var             DBPath = Application.StartupPath + "\\db.mdb";

            conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;Jet OLEDB:Database Password=qlty;");
            conn.Open();
            OleDbCommand cmdUpdate = new OleDbCommand();

            cmdUpdate.Parameters.Clear();
            cmdUpdate.CommandText = sql_update;
            cmdUpdate.CommandType = CommandType.Text;
            cmdUpdate.Parameters.Add("@LIKeys", OleDbType.LongVarChar);
            cmdUpdate.Connection = conn;
            cmdUpdate.ExecuteNonQuery();
            conn.Close();
            label2.Text = "Information Sucessfully Updated";
            msg msg = new msg();

            msg.Show();
            this.Hide();
        }
Exemple #2
0
        private void button8_Click_1(object sender, EventArgs e)
        {
            string sts = "";

            if (comboBox1.Text == "POSITIVE")
            {
                sts = "P";
            }
            else if (comboBox1.Text == "NEGATIVE")
            {
                sts = "N";
            }

            string          sql_update = "UPDATE tblSBReceive SET STS='" + sts + "' WHERE RID=" + eid;
            OleDbConnection conn;
            var             DBPath = Application.StartupPath + "\\db.mdb";

            conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;Jet OLEDB:Database Password=qlty;");
            conn.Open();
            OleDbCommand cmdUpdate = new OleDbCommand();

            cmdUpdate.Parameters.Clear();
            cmdUpdate.CommandText = sql_update;
            cmdUpdate.CommandType = CommandType.Text;
            cmdUpdate.Parameters.Add("@LIKeys", OleDbType.LongVarChar);
            cmdUpdate.Connection = conn;
            cmdUpdate.ExecuteNonQuery();
            conn.Close();
            // label18.Text = "Information Sucessfully Updated";
            msg msg = new msg();

            msg.Show();
            this.Hide();
        }