Jyoti Jodha

Jyoti Jodha

  • NA
  • 1.7k
  • 407k

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

Apr 10 2017 4:35 AM
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)