VB.Net - Datagridview, count specific records in a column RRS feed

  • Question

  • I have a datagridview containing information from a database.  I want to filter the datagrid by date, then count the number of records in a column that contain the name of a city.

    I've been able to filter by date using two datetimepicker controls:

            DBBindingSource.Filter = "DateOfCall >= #" & DTPQry1.Text & "# and DateOfCall <= #" & DTPQry2.Text & "#"

    but I can't find out how to get the count of the number of records that contain the name of a specific city. 

    So if I select a city from a combobox, I would like a textbox beside it to return the total count of records containing the name of that city.

    Monday, December 17, 2012 3:09 AM