PC Review


Reply
Thread Tools Rate Thread

Setting up Query Form

 
 
Brent Burkart
Guest
Posts: n/a
 
      25th Aug 2003
I am new to ado.net and I would like to set up a page which allows the user
to query information. In other words I want them to be able to bring back
information based on the dates they select. Once that information has
returned, I would like to give them further abilility to filter and
eliminate data.

The only way I knew of doing this was to send an SQL query to the database
everytime they select a new piece of information. It sounds as if their
might be a way around this in ADO.NET, but I have not figured it out.
Since all the data is returned in my Dataset, it seems as if I don't need to
reconnect to the database to requery based on another variable.

Is this possible? Any idea is appreciated.

Brent


 
Reply With Quote
 
 
 
 
William Ryan
Guest
Posts: n/a
 
      25th Aug 2003
Yes, it's possible, and simple to implement.

Fire the first query and fill your dataset based on the
date ranges. Right after that, create a module level
DataView like (Assuming the DataView has already been
declared.

dv = myDataSet.Tables(0).DefaultView;

'you can create seperate views for each table if you want.

So let's say you have a field called EmployeeID and you
have a commbo box for instance that lets the user select
the employeee...in the combo's selectedIndexChanged event
all you need to do is dv.RowFilter = "EmployeeID = '"
+cbo.SelectedItem + "'";

You can do the same with any other control although the
event could be different.

Also, depending on how many updates are submitted to the
DB, you may want to periodically refresh your query and
repeat the above steps so data doesn't get stale....that's
dependent on the app though.'

Also, there is a RowStateFilter which allows you to filter
records if they've been added, modified etc.

Let me know if you have any problems.

Cheers,

Bill


W.G. Ryan
(E-Mail Removed)
www.knowdotnet.com
>-----Original Message-----
>I am new to ado.net and I would like to set up a page

which allows the user
>to query information. In other words I want them to be

able to bring back
>information based on the dates they select. Once that

information has
>returned, I would like to give them further abilility to

filter and
>eliminate data.
>
>The only way I knew of doing this was to send an SQL

query to the database
>everytime they select a new piece of information. It

sounds as if their
>might be a way around this in ADO.NET, but I have not

figured it out.
>Since all the data is returned in my Dataset, it seems as

if I don't need to
>reconnect to the database to requery based on another

variable.
>
>Is this possible? Any idea is appreciated.
>
>Brent
>
>
>.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help setting query criteria from a form xsdaver Microsoft Access Forms 3 18th Aug 2008 10:59 PM
setting query criteria from a form (I don't know what to call thi =?Utf-8?B?d2VzdGFq?= Microsoft Access VBA Modules 1 2nd Feb 2006 09:58 PM
Setting Criteria for a Query in a Control on a Form =?Utf-8?B?TXVycA==?= Microsoft Access Forms 3 3rd Dec 2004 06:09 AM
Setting Form RecordSource property returns blank form when no data matches SQL query tina Microsoft Access 0 8th Aug 2003 06:18 PM
Re: Setting Form RecordSource property returns blank form when no data matches SQL query Van T. Dinh Microsoft Access 0 8th Aug 2003 05:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:09 AM.