Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

DataViews and DataSets

Posted on 2004-08-10
3
Medium Priority
?
316 Views
Last Modified: 2010-04-23
Hi there,
I'm new at VB.Net and just have a few questions regarding the way one should create a 'Lookup' screen. For example a screen for a user to search for 'Purchase Orders'
If I have a screen with several fields used as criteria for the rows displayed in the DataGrid, should I use a dataview as the source of the datagrid and set the RowFilter and Sort properties of the Dataview? Can I dynamically build the RowFilter property?
Do I need to 're-Fill' the dataset after setting the Dataview.RowFilter property?

Here is an example of what fields might be on the screen.

A combo box populated with possible Purchase Order statuses.
Two DatePicker combo boxes.
Another combo box which may have different criteria to search by and a text box next to it to type the criteria.
Eg. 'Purchase Order No' and the user can put in the first few digits of the purchase order no.
'Approved By' and the user can put in a name so that the purchase orders displayed are only those created by that name.
etc.

Any help on how to do this or if anyone can point me towards some examples/code for this would be much appreciated.

Thankyou and Regards,
Marnie.
0
Comment
Question by:MarnieHook
  • 2
3 Comments
 
LVL 4

Expert Comment

by:srcalc
ID: 11769180
To answer your first questions: Yes, I would suggest using the DataSet.DefaultView dataview object, it is much more flexible then just the dataview. Yes, you can change the RowFilter property during runtime and you do not need to re-fill. For help with your form controls, you may want to start with this example:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=1AA0FA40-8CDC-41F0-8710-A5826FBBD92E
0
 

Author Comment

by:MarnieHook
ID: 11780736
Hi Srcalc,
Thankyou for your response.
I am still stuck on this one and have posted what is probably a more specific problem with my code.
Your example is more for filling a combo box. I'm trying to filter data in a datagrid which has a dataview as it's datasource.
I'm sure I'll get there soon!!
Thanks again for your help.
Rgads,
Marnie.
0
 
LVL 4

Accepted Solution

by:
srcalc earned 150 total points
ID: 11784810
Can't use just change the rowfilter property of the dataview?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

571 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