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. Web Development
  3. ASP.NET
  4. Bulk Calculation

Bulk Calculation

Scheduled Pinned Locked Moved ASP.NET
databasequestion
4 Posts 3 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.
  • M Offline
    M Offline
    macca24
    wrote on last edited by
    #1

    I have data in a SqlServer table and I want to Select the data into a gridview or something like that and perform a calculation on the data. I want to have a button that will carry out a calulation on all the records displayed and save the total for each record after the calculation to a field in the DB table containing the records. Anyone any ideas on best way to do this?

    Kornfeld Eliyahu PeterK Z 2 Replies Last reply
    0
    • M macca24

      I have data in a SqlServer table and I want to Select the data into a gridview or something like that and perform a calculation on the data. I want to have a button that will carry out a calulation on all the records displayed and save the total for each record after the calculation to a field in the DB table containing the records. Anyone any ideas on best way to do this?

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      There is any reason NOT to do the calculations inside SQL? SQL is pretty good with calculations...

      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      M 1 Reply Last reply
      0
      • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

        There is any reason NOT to do the calculations inside SQL? SQL is pretty good with calculations...

        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

        M Offline
        M Offline
        macca24
        wrote on last edited by
        #3

        Thanks Peter.

        1 Reply Last reply
        0
        • M macca24

          I have data in a SqlServer table and I want to Select the data into a gridview or something like that and perform a calculation on the data. I want to have a button that will carry out a calulation on all the records displayed and save the total for each record after the calculation to a field in the DB table containing the records. Anyone any ideas on best way to do this?

          Z Offline
          Z Offline
          ZurdoDev
          wrote on last edited by
          #4

          macca24 wrote:

          Anyone any ideas on best way to do this?

          In the button click, call a stored procedure that does the calculation and updates the data and then refresh your grid.

          There are only 10 types of people in the world, those who understand binary and those who don't.

          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