codingtcher.com
Theme Night
Home
Login

Sql Update

Home » Sql » Sql Update

sql update

UPDATE computer SET cores = {}, cpu_speed = {}, ram = {}, cost = {} WHERE name = '{}'

SQL Update

private void btnUpdateData_Click(object sender, EventArgs e)
       {
               try
               {
                   SqlComm = new SqlCommand("UPDATE MyDataTable ('DataDesc', 'DataDate', 'DataQty') VALUES ('@DataDesc', '@DataDate', '@DataQty') WHERE DataID ='@DataID'", SqlConn);
                   SqlComm.Parameters.AddWithValue("@DataID", txtDataID.Text);
                   SqlComm.Parameters.AddWithValue("@DataDesc", txtDataDesc.Text);
                   SqlComm.Parameters.AddWithValue("@DataQty", int.Parse(txtDataQty.Text));
                   SqlComm.Parameters.AddWithValue("@DataDate", dtpDataDate.Value);
                   SqlComm.ExecuteNonQuery();

                   MessageBox.Show("Data updated!", "DB Connection With App.Config", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

                   Clear();
                   DisableButtons();
               }
               catch (Exception ex)
               {
                   MessageBox.Show(ex.Message);
               }
           }
Source: www.codeproject.com

SQL/update

UPDATE table_name
SET column1 = value1, column2 = value2...., columnN = valueN
WHERE [condition];
Source: www.tutorialspoint.com

SQL UPDATE Statement

UPDATE Customers
SET first_name = 'Johnny'
WHERE customer_id = 1;

sql update

UPDATE Table_name
-- The desired value
SET Column_name = desired_value
-- Any value, of the item, of which one value you want to change
WHERE Column_name = value

sql Update

UPDATE sakila.actor  # table to update
SET first_name = "Bryan", last_name = "Besmond"   # fields to be added/updated
WHERE actor_id = 201;   # boolean condition

Sql Related Post