Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Filtering data in a DataSet - Datagrid

Posted on 2006-07-03
2
Medium Priority
?
354 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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 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