hi
I have a dataGrid that I should insert its columns values to an access database ...
but I have problem with " command.ExecuteNonQuery();"
my project is not finished just for this error ... please help if you can . it's my code :
for (int i = 0; i < (dataGridFactorRent.Rows.Count) - 1; i++)
{
string query = @"INSERT INTO tbl_RentFactor
([ID],DateNow,customerName,objectName,objectNumber,unitCost,objectCost,paidMoney,restOfMonyy,customerID,DateBack)
VALUES
("+ID+",'" + lbldate.Text + "','" + cmdCustomName.Text + "'," + dataGridFactorRent.Rows[i].Cells[1].Value + ",
" + dataGridFactorRent.Rows[i].Cells[3].Value + ",
" + dataGridFactorRent.Rows[i].Cells[4].Value + ",
" + dataGridFactorRent.Rows[i].Cells[5].Value + ",
'" + txtPaid.Text + "','" + lblRemained.Text + "',
"+customerID+",'"+lbldate.Text+"')";
con.Open();
command.CommandText =query;
command.ExecuteNonQuery();
con.Close();
}