Hello Guys, am getting an error that is
Datetyoe mismatch in criteria expression
everything is perfect fine but when i add date columns so i get this error please guys solve it please
What I have tried:
con_string.Open();
OleDbCommand command = new OleDbCommand() { Connection = con_string };
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
command.CommandText = @"insert into [Total]([column3],[column2],[Flavours],[Remarks],[Column1],[Extra Topping],[Topping Price],[Date])
VALUES (@Column3, @Column2, @Flavours, @Remarks, @Column1, @ExtraTopping, @ToppingPrice,@Date)";
command.Parameters.Clear();
command.Parameters.AddWithValue("@Column3", dataGridView1.Rows[i].Cells[0].Value);
command.Parameters.AddWithValue("@Column2", dataGridView1.Rows[i].Cells[0].Value);
command.Parameters.AddWithValue("@Flavours", dataGridView1.Rows[i].Cells[0].Value);
command.Parameters.AddWithValue("@Remarks", dataGridView1.Rows[i].Cells[0].Value);
command.Parameters.AddWithValue("@Column1", dataGridView1.Rows[i].Cells[0].Value);
command.Parameters.AddWithValue("@ExtraTopping", dataGridView1.Rows[i].Cells[0].Value);
command.Parameters.AddWithValue("@ToppingPrice", dataGridView1.Rows[i].Cells[0].Value);
command.Parameters.AddWithValue("@Date", dataGridView1.Rows[i].Cells[0].Value.ToString());
command.ExecuteNonQuery();
}
con_string.Close()