按日期过滤datagridview [英] Filter datagridview by date

查看:110
本文介绍了按日期过滤datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个称为Selling的表,其中有一个名为DateTime的列,其中非常有趣,其中包含日期和时间.现在,我想过滤我的DataGridView,但是当我按下按钮来过滤项目时,Windows Forms应用程序将冻结.

这是我的查询:

I have a table called selling, with a column called DateTime in it which, cunningly enough, contains date and times. Now, I want to filter my DataGridView, but when I press the button to filter the item, the Windows Forms application freezes.

Here''s my query:

private void button1_Click_1(object sender, EventArgs e)
{
  sellingBindingSource1.Filter = string.Format(
    "SELECT * FROM Selling WHERE DateTime BETWEEN ''10/21/2010'' AND 
    ''10/22/2010''");
}

推荐答案

您可以看到此链接

点击

点击

点击
You can see this link

Click

Click

Click


这篇关于按日期过滤datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆