store array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • little83
    New Member
    • Feb 2009
    • 26

    store array

    Dear all

    If I have array of 500 numbers and I want to store it in sql table database such that each row has its own 500 values by using c#

    any ideas to do that

    thanks
  • semomaniz
    Recognized Expert New Member
    • Oct 2007
    • 210

    #2
    are you trying to each data row will have 500 numbers of its own?

    Comment

    • little83
      New Member
      • Feb 2009
      • 26

      #3
      yea..I am trying to do so...however I am searching to a method to store them in one cell

      Comment

      • semomaniz
        Recognized Expert New Member
        • Oct 2007
        • 210

        #4
        how is your data table designed? One quick solution is to separate the numbers with delimiters and then inserting this to the database.

        Comment

        • little83
          New Member
          • Feb 2009
          • 26

          #5
          the structure is so simple..."X" at first Colume and "Y" at sec. colume and at third colume is receiving signal strength at that position X.Y but one the project requirments to store 500 values of the signal strength at each position..and based on that it is not good solution to store 500 each in a separete cell..because that mean I will extend the table to 504 columes

          so I am searching to a way to store in one cell

          Comment

          • vekipeki
            Recognized Expert New Member
            • Nov 2007
            • 229

            #6
            Large number of columns usually indicates a wrong database design.
            For example, if I understood correctly, you have a table like this:

            Code:
            [  X  ][  Y  ][  Value  ]
               0      0       15.1
               0      1       10.4
               0      2       12.6
            etc.
            which contains all 2D values at a given moment in time. If you now add a DATETIME column, you can keep all your data in rows, and you don't need to care how many different Time values you will have.

            Code:
            [  Time  ][  X  ][  Y  ][  Value  ]
               10:00     0      0       15.1
               10:00     0      1       10.4
               10:00     0      2       12.6
            (...)
               10:01     0      0       15.1
               10:01     0      1       10.4
               10:01     0      2       12.6
            etc.
            This is just a simple example of one way to turn your columns into rows. If you want to learn more about designing databases, Google for "database normalization".

            Comment

            Working...