VB.Net Filter bindingsource using multiple fields

  • Thread starter Thread starter Amol53462
  • Start date Start date
A

Amol53462

Guest
Hello


I would like to filter a bindingsource using two fields. One field is a date and it will be filter source using two datetimepickers.

and another field will be from combobox.text. I am new to VB.net plz help

Dim startdate As Date = DateTimePicker1.Text
Dim enddate As Date = DateTimePicker2.Text
Dim opening As Date = #1/4/2018#

Dim broker As String = D_nameComboBox.Text

If startdate > enddate Then
MsgBox("Please Check the Date ")
DateTimePicker1.Focus()

End If

MainBindingSource.Filter = String.Format("t_date >= #{0:M/dd/yyyy}# AND t_date <= #{1:M/dd/yyyy}#", startdate, enddate)
MainBindingSource.Filter = "dalal_name = '" & broker & "'"

Continue reading...
 
Back
Top