如何在DataGridView上的两个日期之间进行搜索?

时间:2017-04-09 19:15:00

标签: vb.net datagridview

如何使用DataGridView的日期范围过滤DateTimePickers上的记录?

到目前为止,这是我的代码,但是当我点击按钮时,它什么都不做:

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Me.Consulta_DetalleBindingSource.Filter = "FECHA >= '" & DateTimePicker1.Value & "' and FECHA <= '" & DateTimePicker2.Value & "'"
End Sub

这是设置BindingSource

的代码
Me.Consulta_DetalleBindingSource = New System.Windows.Forms.BindingSource(Me.components) 
CType(Me.Consulta_DetalleBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() 
Me.Consulta_DetalleBindingSource.DataMember = "Consulta_Detalle" 
Me.Consulta_DetalleBindingSource.DataSource = Me.AtlánticoDataSet

0 个答案:

没有答案