Link to home
Start Free TrialLog in
Avatar of JMO9966
JMO9966

asked on

Filtering data in a DataSet - Datagrid

Hello,
 
This project involves retrieving records out of a database with a Select statement run through a Data Adapter.
 
I have a show list button on the form that will populate the datagrid.  I'm planning on reading all records from the table into the DataSet and then use this button to filter what will actually appear in the DataGrid.

I've added to From Date and To Date so I plan on using a between statement to populate the DataGrid.  

A friend helped me create a function called CreateTableStyle() to format the column headers and the Mapping Names to get right piece of data displayed in this column.

I'm not sure if I add this data filter to the SQL String query from the form or I apply this filter to the DataSet or just the DataGrid.

What's the preferred method?

Thank You,
Jon
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JMO9966
JMO9966

ASKER

Thanks Bob!

Here's what I ended up with for a Date Range Filter, there was another good expample on Expert Exchange.

dsABC.Tables(0).DefaultView.RowFilter = "Check_Date > #" & Date1 & "# AND Check_Date <  #" & Date2 & "#"


Jon