Как передать значения datagridview из одной формы 1 в форму 2 для вставки базы данных
Как передать значения datagridview из формы 1 в форму 2 для вставки в базу данных для проекта Point of sale. Кто-нибудь, пожалуйста, дайте мне правильное решение
Что я уже пробовал:
private void salesPayment_Click(object sender, EventArgs e) { if (metroGrid1.Rows.Count == 0) { MessageBox.Show("No Products Added for Sales.."); } else { SalesPay popup = new SalesPay(); popup.NetTotal = netPrice.Text; popup.Netgst = gstPrice.Text; DialogResult dialogResult = popup.ShowDialog(); } void dataGridColumns() { for (int i = 0; i <= metroGrid1.Rows.Count - 1; i++) { string prodName = metroGrid1.Rows[i].Cells[0].Value.ToString(); string prodRetailPrice = metroGrid1.Rows[i].Cells[1].Value.ToString(); string prodQuantity = metroGrid1.Rows[i].Cells[2].Value.ToString(); string prodTotalPrice = metroGrid1.Rows[i].Cells[3].Value.ToString(); } }