473,832 Members | 2,132 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset requery

Hi,

In VB6 I used a method requery to repopulate a recordset. I don't find
an equivalent for the .NET dataset.

I don't update my datasets at all, but I use them to navigate through
subsets of my tables, saying my dataset contains primary keys, ordered
in a specific way. When I go the next, previous, first or last record
in the dataset I execute a select stored procedure. When I do an
insert, delete or update I call a stored procedure, implying I should do
a requery of the dataset (subset) because a row might be deleted or
inserted in the database, while it's not reflected in the disconnected
dataset.

Of course I can execute the query to create the dataset again, after
each insert/delete. I wondered there might be a method dataset.requery
or a workaround to achieve this easily??

Thanks a lot,
Kind regards,
Perre Van Wilrijk.
Jan 30 '06 #1
2 3620
I would requery as normal, and merge the result into the original dataset.
If you use a date modified column in your data, you could query where last
modified is greater than the date that you last polled for changes.
"Peter Van Wilrijk" <pr*@koopjeskra nt.be> wrote in message
news:A_******** **************@ phobos.telenet-ops.be...
Hi,

In VB6 I used a method requery to repopulate a recordset. I don't find an
equivalent for the .NET dataset.

I don't update my datasets at all, but I use them to navigate through
subsets of my tables, saying my dataset contains primary keys, ordered in
a specific way. When I go the next, previous, first or last record in the
dataset I execute a select stored procedure. When I do an insert, delete
or update I call a stored procedure, implying I should do a requery of the
dataset (subset) because a row might be deleted or inserted in the
database, while it's not reflected in the disconnected dataset.

Of course I can execute the query to create the dataset again, after each
insert/delete. I wondered there might be a method dataset.requery or a
workaround to achieve this easily??

Thanks a lot,
Kind regards,
Perre Van Wilrijk.

Jan 30 '06 #2
Thanks AMDRIT,

Do you have a link to an example?

I deduct merging 2 datasets (with the same structure) is easily done ...
as using a "union" in SQL?

Can't I get a problem with this workaround if a row was physically
deleted, the row will stay in the dataset I guess ... but there I see
now I always have to check that since another user might have deleted
the row that I have in my susbset of primary keys.

However, I wondered whether the dataset stores the query it was
originally build on. This way I don't have to store that query (and
it's values in the where clause) myself. Actually that's what I meant
to ask, but I didn't make myself very clear. Sorry, no native English
and just switching from VB6 to VB.NET.

Kind regards,
Perre Van Wilrijk.

AMDRIT wrote:
I would requery as normal, and merge the result into the original dataset.
If you use a date modified column in your data, you could query where last
modified is greater than the date that you last polled for changes.
"Peter Van Wilrijk" <pr*@koopjeskra nt.be> wrote in message
news:A_******** **************@ phobos.telenet-ops.be...
Hi,

In VB6 I used a method requery to repopulate a recordset. I don't find an
equivalent for the .NET dataset.

I don't update my datasets at all, but I use them to navigate through
subsets of my tables, saying my dataset contains primary keys, ordered in
a specific way. When I go the next, previous, first or last record in the
dataset I execute a select stored procedure. When I do an insert, delete
or update I call a stored procedure, implying I should do a requery of the
dataset (subset) because a row might be deleted or inserted in the
database, while it's not reflected in the disconnected dataset.

Of course I can execute the query to create the dataset again, after each
insert/delete. I wondered there might be a method dataset.requery or a
workaround to achieve this easily??

Thanks a lot,
Kind regards,
Perre Van Wilrijk.

Jan 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2401
by: pbbriggs | last post by:
I will try to be as descriptive as possible, but this error has me stumped and I am not sure what relevant info to include.... I am running Access XP on a Windows XP machine. I initially began developing an app in Access 2000 but converted it several months ago to XP. So the app is now Access XP format also. My app is crashing on a regular basis, with the totally non-descript Microsoft error (Microsoft Access has encountered a...
20
10691
by: MS | last post by:
Access 97 I want to requery the data being displayed on a form, then I want to return to the record I was in. Why doesn't this code work? Private Sub CmdRefsh_Click()
2
10901
by: F. Michael Miller | last post by:
I need to requery a subform from a third form and can't seem to get it to work. frmForm1 has frmAddress as a subform. The button cmdReviseAddress opens the form frmUpdateAddress where all of my validation work is done and the new record is added. However, the new address is not being displayed in the subform. If I use the command
1
1880
by: Omar | last post by:
Is it possible to requery a dataset and load the result into a few textboxes? I'm trying to requery a dataset (which contains all employees) so it returns only one employee. I don't want to go through the process of connecting to the DB again and filling another temporary DS w/ 1 employee because all the information I need is in the previously populated DS. Thanks.
1
1308
by: Amadelle | last post by:
Hi all and thanks in advance, I was wondering how to cache/persist a dataset between page loads (after button clicks, sorts, filters, etc.)? so that i don't have to requery the database everytime and create a new dataset and a new dataadapter everytime. I know that I can use the Session object and store the dataset in a session object, but I was wondering whether there is a better way of doing this. I appreciate your help and input...
22
5058
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before calling up another form or report that uses some of the same data. We came up with a work around that saves the current record's ID, does a
2
1086
by: Sergei Shelukhin | last post by:
Hi :) I need to store some data in application level dataset. Once a month, a huge query is performed against a set of big tables and the result is stored. The dataset is stored in applicaton level variable and is used to display some report. However there's a problem, the app might restart (because of the changes made by developers), IIS might restart and server can sometimes restart too. I can't requery the data because it will be...
1
9470
by: Parasyke | last post by:
I have a subform within a tabpage that will requery/refresh (?) if I press F9 and it will update the data in the subform, but I have tried various combinations of Me!SubformName.requery Me!Forms!Subformname.requery, etc. to put the F9 functionality into VBA code but nothing seems to work... any ideas? Thanks!
11
7184
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my mind I am wonder if this is causing my problem, but I don’t want to go through the work to convert to DAO unless I know it is truly in my best interest.) I am having problems getting a requery to show up consistently on a couple of forms. I have...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10781
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10499
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4421
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.