Populating data set on background thread

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Populating data set on background thread

    Hi

    I have a master data set. I need to populate a copy of this data set in the
    background (via background thread?) and once filled to replace master data
    set with the newly filled dataset. Is there a code example of this that can
    see?

    Thanks

    Regards


  • Miha Markic

    #2
    Re: Populating data set on background thread

    You might check out BackgroundWorke r component.

    --
    Miha Markic [MVP C#, INETA Country Leader for Slovenia]
    RightHand .NET consulting & development www.rthand.com
    Blog: http://cs.rthand.com/blogs/blog_with_righthand/

    "John" <John@nospam.in fovis.co.ukwrot e in message
    news:OCARvZUdIH A.4196@TK2MSFTN GP04.phx.gbl...
    Hi
    >
    I have a master data set. I need to populate a copy of this data set in
    the background (via background thread?) and once filled to replace master
    data set with the newly filled dataset. Is there a code example of this
    that can see?
    >
    Thanks
    >
    Regards
    >

    Comment

    • John

      #3
      Re: Populating data set on background thread

      Hi Miha

      Thanks. How does one switch datasets?

      Thank again.

      Regards

      "Miha Markic" <miha at rthand comwrote in message
      news:eootArUdIH A.4972@TK2MSFTN GP04.phx.gbl...
      You might check out BackgroundWorke r component.
      >
      --
      Miha Markic [MVP C#, INETA Country Leader for Slovenia]
      RightHand .NET consulting & development www.rthand.com
      Blog: http://cs.rthand.com/blogs/blog_with_righthand/
      >
      "John" <John@nospam.in fovis.co.ukwrot e in message
      news:OCARvZUdIH A.4196@TK2MSFTN GP04.phx.gbl...
      >Hi
      >>
      >I have a master data set. I need to populate a copy of this data set in
      >the background (via background thread?) and once filled to replace
      >master data set with the newly filled dataset. Is there a code example of
      >this that can see?
      >>
      >Thanks
      >>
      >Regards
      >>
      >

      Comment

      • Miha Markic

        #4
        Re: Populating data set on background thread


        "John" <John@nospam.in fovis.co.ukwrot e in message
        news:OFNtw$UdIH A.288@TK2MSFTNG P02.phx.gbl...
        Hi Miha
        >
        Thanks. How does one switch datasets?
        There is no automatic way. Perhaps you could fill one in the background and
        when it is full you could merge it with original (perhaps clear original one
        beforehand). Just make sure that merging or whatever you do you do in form's
        thread.
        --
        Miha Markic [MVP C#, INETA Country Leader for Slovenia]
        RightHand .NET consulting & development www.rthand.com
        Blog: http://cs.rthand.com/blogs/blog_with_righthand/

        Comment

        • RobinS

          #5
          Re: Populating data set on background thread

          If you use a BindingSource to do the binding between your controls and your
          data, you can just replace the data source of the binding source and it will
          take care of repainting your controls.

          RobinS.
          GoldMail, Inc.
          --------------------------------------------------------
          "Miha Markic" <miha at rthand comwrote in message
          news:OlyXEbVdIH A.1376@TK2MSFTN GP02.phx.gbl...
          >
          "John" <John@nospam.in fovis.co.ukwrot e in message
          news:OFNtw$UdIH A.288@TK2MSFTNG P02.phx.gbl...
          >Hi Miha
          >>
          >Thanks. How does one switch datasets?
          >
          There is no automatic way. Perhaps you could fill one in the background
          and when it is full you could merge it with original (perhaps clear
          original one beforehand). Just make sure that merging or whatever you do
          you do in form's thread.
          --
          Miha Markic [MVP C#, INETA Country Leader for Slovenia]
          RightHand .NET consulting & development www.rthand.com
          Blog: http://cs.rthand.com/blogs/blog_with_righthand/

          Comment

          • RobinS

            #6
            Re: Populating data set on background thread

            One more thing. This is what I'm doing, and you replace the data source in
            the event that gets fired when your thread completes its retrieval of the
            new data.

            RobinS.
            GoldMail, Inc.
            ----------------------------------------------
            "RobinS" <robins@imnotte lling.comwrote in message
            news:Go6dnWC2_t Vd4SLanZ2dnUVZ_ h2pnZ2d@comcast .com...
            If you use a BindingSource to do the binding between your controls and
            your data, you can just replace the data source of the binding source and
            it will take care of repainting your controls.
            >
            RobinS.
            GoldMail, Inc.
            --------------------------------------------------------
            "Miha Markic" <miha at rthand comwrote in message
            news:OlyXEbVdIH A.1376@TK2MSFTN GP02.phx.gbl...
            >>
            >"John" <John@nospam.in fovis.co.ukwrot e in message
            >news:OFNtw$UdI HA.288@TK2MSFTN GP02.phx.gbl...
            >>Hi Miha
            >>>
            >>Thanks. How does one switch datasets?
            >>
            >There is no automatic way. Perhaps you could fill one in the background
            >and when it is full you could merge it with original (perhaps clear
            >original one beforehand). Just make sure that merging or whatever you do
            >you do in form's thread.
            >--
            >Miha Markic [MVP C#, INETA Country Leader for Slovenia]
            >RightHand .NET consulting & development www.rthand.com
            >Blog: http://cs.rthand.com/blogs/blog_with_righthand/
            >

            Comment

            Working...