Windows Develop Bookmark and Share   
 index > Windows Forms General > Performance problem
 

Performance problem

Hi,
We came in a performance/binding issue when we want to return the refreshed data from Webservice to the client . The first one(A) has performance issue with very high cpu usage and the second one(B) lost the data binding. 

A) To return the refreshed data from the web services to the client we used Merge method As follow: 

clientDataSet.Merge(“â€?.call a method in webservice to return dataset with fresh data..â€?nbsp;) 

This works but has a poor performance with high cpu usage. 
Q1 : Any other alternative to return the data from web service to the client without using Merge method? 


B) If we simply change the above code to the following (with no Merge) then will have a better performance with low cpu usage. 

ClientDataSet=“â€?.call a method in webservice to return dataset with fresh data..â€?nbsp;

But we lose the data binding in client side. Means, now the refreshed data are in the client dataset but these values are not bind to the screen fields any more. 
Q2: what is the relation between Merge and data binding? 

I would appreciated to share with me Any better idea to get ride of these issues 
Thanksâ€?Ali 

P.S.: I already posetd this question in a wrong forum that's why reposted here again,sorry.

MigrationUser 1  Tuesday, September 16, 2003 10:50 AM
Merging simply updates the current tables in the current dataset with the new tables in the new dataset.

Setting the variable 'ClientDataSet' to a new dataset changes a pointer behind the seens. 'ClientDataSet' now points to the new dataset instead of the old one. The old dataset does not go away because the controls still point (or are bound) to it. 


I have used a little ingenuity to solve these types of problems in the past.  My goal is usually to lower the amount of data going across the wire.  When refreshes like the one you describe are frequent, I keep track of all updates on the server with a log table (via triggers or Stored Procs). Your refresh query can then be qualified to only get the changes (which can be zero rows). You can then spin through the dataset updating by primary key as per log entry (remember deletes are possible).   Takes more code but is usually much quicker.

Your other choice is to reset the 'ClientDataSet' variable to the new dataset and rebind all of the controls.  
MigrationUser 1  Wednesday, September 17, 2003 3:17 PM

You can use google to search for other answers

Custom Search

More Threads

• TabControl is flickering too much (tried remedies suggested in this forum to no avail)
• display multiple lines string in textbox
• Set printing page size to legal
• Problem with XP registry file - help needed
• Keyevent F5
• Visual Studio.Net after 1.0 -> 1.1 Upgrade
• public string (Forms + Class)
• How to persist UI state between executions?
• Can I use the outlook look and feel?
• Uniquely identify a control in a window using Object Name