Solved

Filtering data in a DataSet - Datagrid

Posted on 2006-07-03
2
352 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:JMO9966
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 17033040
Apply a filter to the DataTable.  

Here is an example:
   DataSet1.Tables("Table1").DefaultView.RowFilter = "ID = 5"

Bob
0
 

Author Comment

by:JMO9966
ID: 17033497
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
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question