Israel

Israel

  • 692
  • 1.3k
  • 219.3k

between two dates for Msaccess database...

Nov 12 2014 9:47 AM
Hi!
 
I do make filter for one date for one column belonging to a database.
This is the code. Its works fine:
 
private void dataReservasviaturas_ValueChanged(object sender, EventArgs e)
{
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from personel where dataworkers like ('" + datetimeworker.Text + "%')";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(dt);
conn.Close();
dataGridView1.DataSource = dt;
}
 
But I would like to learn how can I make filter between two dates using two datetimepickers.
 
Thanx. 

Answers (9)