473,511 Members | 16,730 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reload only changes in dataset

Hello group,

what would be the best way to do the next thing: I've got a grid form with
about 15000 records, when I double click a row a detail form is opened and
the user can modify and save the record, this all works just fine, then the
user closes the detail form and ofcourse I want to show his modifications in
the grid form, but now my question is what's the best way to do this without
completely reloading the dataset that holds the records showed in the
datagrid, is there a way to only reload the changed/new rows. The other
problem is there could be 10 or so users who have the program open so also
their modifications should be visible.

Thanks for any tips or help

Greetz Peter
Nov 21 '05 #1
4 1844
Peter,

What I write here is only valid when you don't use the autoincrement primary
key however us a GUID as primarykey.

First when you have without any error updated a database with your last
changes, what data you want to have changed in your datagrid, are the
updates not the last changes. The datagrid should than show how *those*
datarows are now in the database?

A way to write this, where I don't write in this sample the absolute needed
errorhandling
\\\
if ds.haschanges
da.update(ds.getchanges)
ds.acceptchanges 'this is important here because the getchanges create a
copy dataset
end if
///

I took some time to write the text right. Because it is than not necessary
that the Dataset does reflects the Database. New records added, updates or
deletes by other users are not in that dataset as long as you don't do an
update for those rows. This should, when you did it well, throw an error
when you update your datarows and will never be with a new by others added
one.

You are working with a disconnected dataset, there is not any refreshment
when you don't do it.
I have seen solutions in these newsgroups for when that is necessary (And
that is than with huge datasets). Adding a timestamp, reading those before
the moment of an update can give a solution, however that I never did or
tried.

This is the behaviours from the disconnected dataset, for which a theory is,
that this in most situations will seldom happen. You see me probably often
writting in these newsgroups to keep the datasets as small as possible. Here
you have my main reason for those small datasets.

For more information from others beside in this newsgroup, I advice you to
put this question as well in the newsgroup
microsoft.public.dotnet.framework.adonet

It is often asked, however I don't tell you to search in those messages,
because this is a subject what I never saw really direct nice explained or
where a good link for information was given.

I hope I succeeded a little bit in explaining, however keep in mind that
this is a newsgroup message, so what I write can be understanded wrong by
you or been by me and should only be taken (as forever) as hints to help you
to find the right solutions.

I hope it helps anyway something.

Cor



Nov 21 '05 #2
Hi Cor,

first thanks for your explanation, I think I get what you mean, but the
problem I have is that the dataset has no changes. You wrote:
A way to write this, where I don't write in this sample the absolute needed errorhandling
\\\
if ds.haschanges
da.update(ds.getchanges)
ds.acceptchanges 'this is important here because the getchanges create a copy dataset
end if
///
But my ds has no changes because it's on the grid form and I don't use it
for the updates/inserts, the updates and inserts happen on an other form
where an insert or update command get's generated and executed and then when
the user closes his update/insert form I would like to refresh the dataset
on the grid form so that only the changes made to the database get refreshed
in the dataset and the other records stay unchanged (not reloaded), but from
what I understand from your explanation this isn't possible?

Greetz and thanks again Peter

"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:Of**************@TK2MSFTNGP09.phx.gbl... Peter,

What I write here is only valid when you don't use the autoincrement primary key however us a GUID as primarykey.

First when you have without any error updated a database with your last
changes, what data you want to have changed in your datagrid, are the
updates not the last changes. The datagrid should than show how *those*
datarows are now in the database?

A way to write this, where I don't write in this sample the absolute needed errorhandling
\\\
if ds.haschanges
da.update(ds.getchanges)
ds.acceptchanges 'this is important here because the getchanges create a copy dataset
end if
///

I took some time to write the text right. Because it is than not necessary
that the Dataset does reflects the Database. New records added, updates or
deletes by other users are not in that dataset as long as you don't do an
update for those rows. This should, when you did it well, throw an error
when you update your datarows and will never be with a new by others added
one.

You are working with a disconnected dataset, there is not any refreshment
when you don't do it.
I have seen solutions in these newsgroups for when that is necessary (And
that is than with huge datasets). Adding a timestamp, reading those before
the moment of an update can give a solution, however that I never did or
tried.

This is the behaviours from the disconnected dataset, for which a theory is, that this in most situations will seldom happen. You see me probably often
writting in these newsgroups to keep the datasets as small as possible. Here you have my main reason for those small datasets.

For more information from others beside in this newsgroup, I advice you to put this question as well in the newsgroup
microsoft.public.dotnet.framework.adonet

It is often asked, however I don't tell you to search in those messages,
because this is a subject what I never saw really direct nice explained or
where a good link for information was given.

I hope I succeeded a little bit in explaining, however keep in mind that
this is a newsgroup message, so what I write can be understanded wrong by
you or been by me and should only be taken (as forever) as hints to help you to find the right solutions.

I hope it helps anyway something.

Cor



Nov 21 '05 #3
Peter,

Your problem will forever be the deletes or you should create a very special
routine around that. Which depends than how long it takes to completly to
do a new fill from that dataset and that depends than again what database
server you are using.

Just my thought,

Cor
Nov 21 '05 #4
Cor,

Just for your information, I'm using a SQL Server. But I guess I've got some
analyzing to do, because here at work we use our own framework (grid/detail
forms and so on), so maybe it's time for a new control with the grid and
detail fields on the same form. But the reason why I asked this question is
because a collegue of mine has a program on citrix with in one grid about
15.000-20.000 records and users notice that after about 30 times of opening
a detail form from the grid, change something, close the detail form, open
an other rercord from the grind an so on. The datagrid gets filled slower
and slower.

Greetz Peter and thanks again

"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:u3*************@TK2MSFTNGP15.phx.gbl...
Peter,

Your problem will forever be the deletes or you should create a very special routine around that. Which depends than how long it takes to completly to
do a new fill from that dataset and that depends than again what database
server you are using.

Just my thought,

Cor

Nov 21 '05 #5

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

Similar topics

2
9492
by: kimbuba | last post by:
Hi all, i'm writing cause i'm not able to find any good resources about this topic. I'm programming on tomcat and i have my browser open to see changes i made. The problem is that i'd like to see...
66
3828
by: Ellinghaus, Lance | last post by:
> > Other surprises: Deprecating reload() >Reload doesn't work the way most people think >it does: if you've got any references to the old module, >they stay around. They aren't replaced. ...
4
1801
by: David MacQuigg | last post by:
I'm going to be teaching EEs some basic Python using the first few chapters of Learning Python, 2nd ed. by Mark Lutz. The discussion on Reloading Modules starting on page 266 is confusing and I...
0
1843
by: fhiemstra0507 | last post by:
Hi I have a listbox that I want to update when the an item is updated/added. Now the listbox is attached to a query. Now I tried to just reload the query by modifying the forms loadDataSet and...
10
1656
by: riversmithco | last post by:
This should be easy, How do I reload a page so that it makes the server think it's the first time the page has been loaded? Thanks
8
16988
by: Mats Lycken | last post by:
Hi, I'm working on a webproject where I have several different user controls loaded on a WebForm. A problem arises when I in one webcontrol makes a change that should be picked up by another user...
3
2169
by: John Salerno | last post by:
I understand that after you import something once, you can reload it to pick up new changes. But does reload work with from statements? I tried this: from X import * and then did my testing....
0
1203
by: menno.abbink | last post by:
Hi All, I'm asked to come up with a sollution for the following: We are developing an application that will be displayed on a videowall ( at least 4000 x 2000 pixels) that will be used to...
7
24514
by: Raffi | last post by:
I'm facing a tricky (at least for me) page reload/refresh scenario and need some help. I'm working on a web application which is primarily used with MSIE. The application has a main window with...
0
7138
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...
0
7355
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,...
0
7423
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...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5066
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...
0
3225
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...
0
1576
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 ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.