I solved the problem. I had to Convert.ToDateTime the TextBox Texts and fix the code to filter the records. SEe the correct code below:
private void buttonFilter_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrEmpty(textBoxDataIni.Text) || string.IsNullOrEmpty(textBoxDataFin.Text))
{
this.qry_retornosBindingSource.Filter = string.Empty;
}
else
{
this.qry_retornosBindingSource.Filter = string.Format("Data >= '{0}' AND Data <= '{1}'", Convert.ToDateTime(textBoxDataIni.Text), Convert.ToDateTime(textBoxDataFin.Text));
}
}
catch (Exception)
{
}
}