DataSet.Copy is very slowly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • louche
    New Member
    • Apr 2010
    • 3

    DataSet.Copy is very slowly

    A dataSet(global variable) is shared between two serial threads. one thread change the dataset, and the other thread save the dataSet to DB2. In the later thread, one action is copy the shared dataset( use the DataSet.Copy()) . After the previous thread run once. the later thread is very slowly. the time used on the copy action is about 22 seconds. But if the previous thread stoped, the time exhausted on copy action is 5 seconds.

    the code of copy action showed as follows:

    Code:
    public static void SynchronizeFromPlan(DataSet update, DataSet orDataSet)
            {
                sychronized = false;
                if (update == null && orDataSet == null) return;
                AddDataSetIncreasement(update, false, System.DateTime.Now);
                if (!sychronized && orDataSet != null)
                {                
                    AddDataSetIncreasement([B]orDataSet.Copy[/B](), true, System.DateTime.Now);
                    sychronized = true;
                }
            }
    Thanks in advance
    Last edited by tlhintoq; Apr 22 '10, 03:28 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    TIP: When you first created your question you were asked to wrap your code with [code] tags.
    [imgnothumb]http://files.me.com/tlhintoq/10jihf[/imgnothumb]
    It really does help a bunch. Look how much easier it is to read now that someone has done it for you. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Originally posted by OriginalPoster
      I have xxx, then do yyy then zzz happens. Here's my code ...
      Ok. You know what you have.
      What you don't have is a question. Nobody here knows why you posted this since you haven't asked anything. What is it you are looking for?
      I recommend you read the FAQ about How to ask a good question so the volunteers will be able to help you.

      Comment

      • louche
        New Member
        • Apr 2010
        • 3

        #4
        My question is Why the DataSet.copy is so slowly? How to impove the speed of DataSet.copy() in my application.

        Comment

        • louche
          New Member
          • Apr 2010
          • 3

          #5
          The question is not solved yet. Now some times the time exhausted on DataSet.copy() exceeds 4 minutes. The normal time exhausted is 20 seconds.
          does anyone have any hints?

          Comment

          Working...