SqlCommandBuilder (da);. Fill (data);. DataSource = data;
} break; 8:
{
// Продуктиsql = String. Format ("select * from {0};", "v_prod"); = new DataTable (); = new MySqlDataAdapter (sql, connStr); = new MySqlCommandBuilder (da);. Fill (data);. DataSource = data;. Sort (dataGridView10. Columns [0], ListSortDirection. Ascending);
// Shops = String. Format ("select * from {0};", "shop"); = new DataTable (); = new MySqlDataAdapter (sql, connStr); = new MySqlCommandBuilder (da);. Fill (data);. DataSource = data;. Sort (dataGridView11. Columns [0], ListSortDirection. Ascending);
// v_Shop_Ex = String. Format ("select * from {0};", "v_shop_ex"); = new DataTable (); = new MySqlDataAdapter (sql, connStr); = new MySqlCommandBuilder (da);. Fill (data);. DataSource = data;. Sort (dataGridView12. Columns [0], ListSortDirection. Ascending);
} break;
}
}
// Addvoid button3_Click (object sender, EventArgs e)
{sql = String. Format ("insert into {0} (shop_ex_id, name_client) values ​​('{2}', '{1}") "," clients ", textBox4. Text, textBox5. Text);
{= new MySqlCommand (sql, conn);. ExecuteNonQuery ();
} (Exception ex)
{. Show ("Exception:" + ex. Message);
} = new DataTable (); = String. Format ("select * from {0};", "clients"); = new MySqlDataAdapter (sql, connStr); = new MySqlCommandBuilder (da);. Fill (data);. DataSource = data;
}
// Deletevoid button2_Click (object sender, EventArgs e)
{= new DataTable (); sql = String. Format ("delete from {0} where ({1} = {2});", "clients", "ID", textBox6. Text); = new MySqlDataAdapter (sql, conn); = new MySqlCommandBuilder (da);. Fill (data); = new DataTable (); = String. Format ("select * from {0};", "clients"); = new MySqlDataAdapter (sql, connStr); = new MySqlCommandBuilder (da);. Fill (data);. DataSource = data;
}
// add prodvoid button4_Click (object sender, EventArgs e)
{sql = String. Format ("insert into {0} (name, type_ex_id, id_manufacturer, id_supplier, price) values ​​('{1}', '{2}', '{3}', '{4}', '{5} ') "," production ",. Text, textBox7. Text, textBox8. Text, textBox9. Text, textBox11. Text);
{= new MySqlCommand (sql, conn);. ExecuteNonQuery ();
} (Exception ex)
{. Show ("Exception:" + ex. Message);
} = new DataTable (); = String. Format ("select * from {0};", "v_prod"); = new MySqlDataAdapter (sql, connStr); = new MySqlCommandBuilder (da);. Fill (data);...