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. Database & SysAdmin
  3. Database
  4. Better way of iteration

Better way of iteration

Scheduled Pinned Locked Moved Database
databasecomtoolsquestionannouncement
6 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.
  • S Offline
    S Offline
    sreejith ss nair
    wrote on last edited by
    #1

    hi there, I have a collection of record in a data table which is populated from a dataset. I would like to replace some field values in that data table. This replacement is temporary (I am not going to update it back to database or dataset). Eg: EmpID EmpName 1101 My Name 1102 Your Name What I need to do is, I need to replace all "Emp ID" values to it's corresponding encrypted value. Answer will be EmpID EmpName xabc My Name ssbc Your Name Now I am iterating through individual records of my data table and updating with my required value. The iteration took little more time, when I deal with lot of records. Is there any better way to achieve my result.:-O Sreejith Nair [ My Articles ]

    S J 2 Replies Last reply
    0
    • S sreejith ss nair

      hi there, I have a collection of record in a data table which is populated from a dataset. I would like to replace some field values in that data table. This replacement is temporary (I am not going to update it back to database or dataset). Eg: EmpID EmpName 1101 My Name 1102 Your Name What I need to do is, I need to replace all "Emp ID" values to it's corresponding encrypted value. Answer will be EmpID EmpName xabc My Name ssbc Your Name Now I am iterating through individual records of my data table and updating with my required value. The iteration took little more time, when I deal with lot of records. Is there any better way to achieve my result.:-O Sreejith Nair [ My Articles ]

      S Offline
      S Offline
      ScottSingleton
      wrote on last edited by
      #2

      Are you using SQL server or Access or ?? can your Encryption code be ported to Transact-SQL? If so I would simply create a function that encrypts your values and run it at the server and represents it in a view.


      'Cause I'm living on things that excite me, be it pastries or lobsters or love...
      I'm just trying to get by, being quiet and shy, in a world full of push and shove...
      Jimmy Buffett - The Wino and I know

      S 1 Reply Last reply
      0
      • S ScottSingleton

        Are you using SQL server or Access or ?? can your Encryption code be ported to Transact-SQL? If so I would simply create a function that encrypts your values and run it at the server and represents it in a view.


        'Cause I'm living on things that excite me, be it pastries or lobsters or love...
        I'm just trying to get by, being quiet and shy, in a world full of push and shove...
        Jimmy Buffett - The Wino and I know

        S Offline
        S Offline
        sreejith ss nair
        wrote on last edited by
        #3

        Not at all possible. I can't ship the encription algoritham with T-SQL. Sybase is the database. Sreejith Nair [ My Articles ]

        1 Reply Last reply
        0
        • S sreejith ss nair

          hi there, I have a collection of record in a data table which is populated from a dataset. I would like to replace some field values in that data table. This replacement is temporary (I am not going to update it back to database or dataset). Eg: EmpID EmpName 1101 My Name 1102 Your Name What I need to do is, I need to replace all "Emp ID" values to it's corresponding encrypted value. Answer will be EmpID EmpName xabc My Name ssbc Your Name Now I am iterating through individual records of my data table and updating with my required value. The iteration took little more time, when I deal with lot of records. Is there any better way to achieve my result.:-O Sreejith Nair [ My Articles ]

          J Offline
          J Offline
          Jon Hulatt
          wrote on last edited by
          #4

          If you're not going to update the database with the new values, why bother putting the values in the dataset? You could use some kind of intrinsic data object to the language you're using. Such as an array or a collection.

          using System.Beer;

          S 1 Reply Last reply
          0
          • J Jon Hulatt

            If you're not going to update the database with the new values, why bother putting the values in the dataset? You could use some kind of intrinsic data object to the language you're using. Such as an array or a collection.

            using System.Beer;

            S Offline
            S Offline
            sreejith ss nair
            wrote on last edited by
            #5

            I want to use all methods which normally offered by dataset and data table. This is the main reason that, i am keeping all values in DataTable. Now do you think arraylist is good enough ? Sreejith Nair [ My Articles ]

            J 1 Reply Last reply
            0
            • S sreejith ss nair

              I want to use all methods which normally offered by dataset and data table. This is the main reason that, i am keeping all values in DataTable. Now do you think arraylist is good enough ? Sreejith Nair [ My Articles ]

              J Offline
              J Offline
              Jon Hulatt
              wrote on last edited by
              #6

              Well you've answered your own question. If updating the dataset is too slow, then you need to do it a different way.

              using System.Beer;

              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