private void button1_Click(object sender, RoutedEventArgs e) { MySqlConnection conn = new MySqlConnection(connectionSQL); conn.Open(); DataSet ds = new DataSet(); MySqlDataAdapter da = new MySqlDataAdapter("Select barcode, name, price from Product WHERE barcode='" + textBox1.Text + "'", conn); MySqlCommandBuilder cmd = new MySqlCommandBuilder(da); da.Fill(ds); ds.Tables[0].Columns.Add(new DataColumn("Quantity")); for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { ds.Tables[0].Rows[i]["Quantity"] = textBox2.Text; } this.dataGrid1.ItemsSource = ds.Tables[0].DefaultView; conn.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)