9
Answers

between two dates for Msaccess database...

Israel

Israel

10y
639
1
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)