Hi Guys,
I have a form with a DGV and some text boxes.. I am trying to get the program to update the rows shown on the DGV by using the values in the text boxes.
Below is my code so far:
private void btnOrderEdit_Click(object sender, EventArgs e)
{
System.Data.OleDb.OleDbCommandBuilder cb;
cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA);
System.Data.DataRow dRow2 = cashOrdersDS.Tables["cashOrders"].Rows[0];
dRow2[1] = Int64.Parse(txtOrderQTY.Text);
dRow2[2] = txtBoxDescrip.Text.ToString();
dRow2[3] = txtBoxSupplier.Text.ToString();
dRow2[4] = dateTimePicker1.Value.ToString();
dRow2[5] = Convert.ToDouble(txtBoxCost.Text);
dRow2[6] = Convert.ToDouble(txtBoxSell.Text);
dRow2[7] = Int64.Parse(textBox1.Text);
cashDA.Update(cashOrdersDS, "cashOrders");
MessageBox.Show("Data Updated");
}
Any help would be great!