By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,380 Members | 3,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,380 IT Pros & Developers. It's quick & easy.

store array

P: 26
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
Feb 10 '09 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 210
are you trying to each data row will have 500 numbers of its own?
Feb 10 '09 #2

P: 26
yea..I am trying to do so...however I am searching to a method to store them in one cell
Feb 10 '09 #3

Expert 100+
P: 210
how is your data table designed? One quick solution is to separate the numbers with delimiters and then inserting this to the database.
Feb 10 '09 #4

P: 26
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
Feb 10 '09 #5

vekipeki
Expert 100+
P: 229
Large number of columns usually indicates a wrong database design.
For example, if I understood correctly, you have a table like this:

Expand|Select|Wrap|Line Numbers
  1. [  X  ][  Y  ][  Value  ]
  2.    0      0       15.1
  3.    0      1       10.4
  4.    0      2       12.6
  5. 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.

Expand|Select|Wrap|Line Numbers
  1. [  Time  ][  X  ][  Y  ][  Value  ]
  2.    10:00     0      0       15.1
  3.    10:00     0      1       10.4
  4.    10:00     0      2       12.6
  5. (...)
  6.    10:01     0      0       15.1
  7.    10:01     0      1       10.4
  8.    10:01     0      2       12.6
  9. 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".
Feb 11 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.