Как передать значения datagridview из формы 1 в форму 2 В C#
Once i Click the payment button and then open the form like popup, and then how to pass datagridview and invoice number values from that popup to insert into database using c#. Please give me someone for proper solution
Что я уже пробовал:
else { SalesPay popup = new SalesPay(); popup.NetTotal = netPrice.Text; popup.Netgst = gstPrice.Text; this.dataGridColumns(); DialogResult dialogResult = popup.ShowDialog(); } } private 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(); } }
Graeme_Grant
Пожалуйста,не перепечатывайте вопросы. Вместо этого обновите исходный вопрос. На первоначальный вопрос уже есть ответы: Как передать значения datagridview из одной формы 1 в форму 2 для вставки базы данных[^]