12
Answers

incorrect syntax near ' 0'. in window Application c#

Jyoti Jodha

Jyoti Jodha

7y
1.4k
1
foreach (DataGridViewRow g1 in dataGridView.Rows)
{
cmd = new SqlCommand("insert into MainBillForm Values (Datetxt.Text,Nametxt.Text,Phtxt.Text,ONtxt.Text,TotalTaxtxt.Text,totalamounttxt.Text,row.Cells[0].FormattedValue.ToString(),row.Cells[1].FormattedValue.ToString(),row.Cells[2].FormattedValue.ToString(),row.Cells[3].FormattedValue.ToString(),row.Cells[4].FormattedValue.ToString(),row.Cells[5].FormattedValue.ToString(),row.Cells[6].FormattedValue.ToString())", con);
con.Open();
cmd.ExecuteNonQuery();
MessageBox.Show("Records Inserted SuccessFully");
con.Close();
}
Answers (12)