473,714 Members | 2,572 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 1852
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.ge tchanges)
ds.acceptchange s '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.publi c.dotnet.framew ork.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.ge tchanges)
ds.acceptchange s '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******** ******@TK2MSFTN GP09.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.ge tchanges)
ds.acceptchange s '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.publi c.dotnet.framew ork.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******** *****@TK2MSFTNG P15.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
9510
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 changes immediatly, is there a way to do this, but using start-stop-reload from tomcato manager admin? I tried to add this to server.xml <Context path="/info" docBase="info" debug="0" reloadable="true">
66
3886
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. >It was a good idea, but the implementation simply >doesn't do what the idea promises. I agree that it does not really work as most people think it does, but how
4
1806
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 believe incorrect. On page 266 it says that a reload "changes the existing module object in place." That's a little vague, but on page 267 it says "every reference to a module object anywhere in your program is automatically affected by a...
0
1852
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 filldataset subroutines but when I do that the table values do not mesh which the lstbox anymore. As well, I have looked at the data adapters select statement to try and update it but to no avail. Any suggestions?
10
1668
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
17000
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 control. For example a webshop. I have a datagrid of products in the shopping cart in one user control. In another I have an overview of the shopping cart (lists the products and a shows an order total). When I remove a product from my datagrid...
3
2182
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. I changed X and tried to reload it, but that didn't seem to work. I figure the reason is because the module itself doesn't exist as an object, only its names do. But I couldn't figure out how to pick up my new changes at this point. I think...
0
1211
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 monitor the actual state of several objects. We are thinking of using Scalable Vector Graphics to display the objects and the relations between them. The application needs to change the color of the objects whenever an event occurs (e.g. network link...
7
24541
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 an i-frame in it. The i-frame contains various dynamic links for opening data entry popups. One of these popups has a couple of i-frames itself. These i-frames also have links to scripts which make changes to a server side database. I need for...
0
8796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
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...
1
9071
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9009
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7946
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...
0
4462
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
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3155
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
3
2105
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.