Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Implementing stop functionality for downloading data from db in WPF app in MVP

Implementing stop functionality for downloading data from db in WPF app in MVP

Scheduled Pinned Locked Moved WPF
databasearchitecturecsharpwpfhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Krishna Aditya
    wrote on last edited by
    #1

    Hi In my WPF windows app, with MVP architecture, I have to download data from database into excel sheet with DOWNLOAD button. I have an another button STOP which has to stop the current process of downloading . Say, for eg: I have data to download into 5 excel files, after a min or so, if i click stop button, it shuld stop at the point of downloading and by this time if it had copied to 2 files, then it should remain.. I am trying out for 1. The click of Download btn should start downloading(now its happening.. corrctly..) . But When i click stop it should stop at the point of downloading and retain the data... 2. Also, I have added an wpf progress bar.so the downloading of hte data should be linked with the progress bar data.. i mean if ti takes 170 secs to download from db, the progress bar should display the status of it.. Kindly help me. Thank you, Ramm

    C 1 Reply Last reply
    0
    • K Krishna Aditya

      Hi In my WPF windows app, with MVP architecture, I have to download data from database into excel sheet with DOWNLOAD button. I have an another button STOP which has to stop the current process of downloading . Say, for eg: I have data to download into 5 excel files, after a min or so, if i click stop button, it shuld stop at the point of downloading and by this time if it had copied to 2 files, then it should remain.. I am trying out for 1. The click of Download btn should start downloading(now its happening.. corrctly..) . But When i click stop it should stop at the point of downloading and retain the data... 2. Also, I have added an wpf progress bar.so the downloading of hte data should be linked with the progress bar data.. i mean if ti takes 170 secs to download from db, the progress bar should display the status of it.. Kindly help me. Thank you, Ramm

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to run your download on another thread. You can then do progress notifications if it's a backgroundworker thread. To do a progress bar, you'd need to read your file a line at a time, so you know where you are at, to report progress. Or you can show progress one file at a time, and stop on that basis. What is MVP architecture, do you mean MVC ?

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      K 1 Reply Last reply
      0
      • C Christian Graus

        You need to run your download on another thread. You can then do progress notifications if it's a backgroundworker thread. To do a progress bar, you'd need to read your file a line at a time, so you know where you are at, to report progress. Or you can show progress one file at a time, and stop on that basis. What is MVP architecture, do you mean MVC ?

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        K Offline
        K Offline
        Krishna Aditya
        wrote on last edited by
        #3

        Thanks Christian for the inputs. so, the progress bar progress should be captured based on the total time it takes to download? Add all the files downloading time and show it in progress bar as whole?? MVP is Model view presenter. earlier we have Model-View-viewModel...and instead of MVC, we can use MVP architecture too. Presenter has the ways of presenting the user requirements. Thank You, Ramm

        C 1 Reply Last reply
        0
        • K Krishna Aditya

          Thanks Christian for the inputs. so, the progress bar progress should be captured based on the total time it takes to download? Add all the files downloading time and show it in progress bar as whole?? MVP is Model view presenter. earlier we have Model-View-viewModel...and instead of MVC, we can use MVP architecture too. Presenter has the ways of presenting the user requirements. Thank You, Ramm

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Krishna Aditya wrote:

          so, the progress bar progress should be captured based on the total time it takes to download?

          Well, it's up to you to work out what granularity of data you're capable of capturing, the point really is that I think if you have 5 files, five progress steps makes the most sense.

          Krishna Aditya wrote:

          MVP is Model view presenter. earlier we have Model-View-viewModel...and instead of MVC, we can use MVP architecture too

          Sounds overly convoluted to me.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups