473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Redimension an array

Greetings to all, i need to create a matrix (or something that make the job)
to store 3 values per row to insert everything (there will be several rows)
later in my database but i canÂīt find a way to do it, any help can be usefull.

Thank you in advance.

Oct 19 '06 #1
3 1876
Well, you can use a DataTable that directly represents the table of the
database, which will allow for easier insertion. Or you can just use
an array of arrays... or a multidimensional array (see
http://www.c-sharpcorner.com/Code/20...ithArrays.asp).
Any number of options. Probably the best approach would be to work
with DataSets/DataTables, since that way you can even validate that
your database won't choke on the data the moment you insert into the
collection, instead of waiting until you try to reach the DB... but
that's also the most complex. Probably the bext approach for you would
be a list of arrays - IE:

List<string[]myList = new List<string[]>();

Wherein you can just insert using something like
List.Append(new string[]{firstval, secondval, thirdval});

or somesuch nonsense.

Logan wrote:
Greetings to all, i need to create a matrix (or something that make the job)
to store 3 values per row to insert everything (there will be several rows)
later in my database but i canīt find a way to do it, any help can be usefull.

Thank you in advance.
Oct 19 '06 #2
Maybe try using a generic List of string arrays, like this:

List<string[]myList = new List<string[]>();
myList.Add(new string[] {"woo", "yay", "hoopla"});

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/
Logan wrote:
Greetings to all, i need to create a matrix (or something that make the job)
to store 3 values per row to insert everything (there will be several rows)
later in my database but i canīt find a way to do it, any help can be usefull.

Thank you in advance.
Oct 19 '06 #3
I was trying to use a datatable, but everytime i click the ok button, it was
in 0 cols and rows, i was trying to set all the values before saving. but i
can't figure it out how to keep all my values.

Oct 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brian | last post by:
I'm diddlying with a script, and found some behavior I don't understand. Take this snippet: for ($i = 0; $i <= count($m); $i++) { array_shift($m); reset($m); }
2
by: Stormkid | last post by:
Hi Group I'm trying to figure out a way that I can take two (two dimensional) arrays and avShed and shed, and subtract the matching elements in shed from avShed I've pasted the arrays blow from a...
15
by: lawrence | last post by:
I wanted to test xml_parse_into_struct() so I took the example off of www.php.net and put this code up on a site: <?php $simple = <<<END <item>
8
by: vcardillo | last post by:
Hello all, Okay, I am having some troubles. What I am doing here is dealing with an employee hierarchy that is stored in an array. It looks like this: $employees = array( "user_id" => array(...
12
by: Sam Collett | last post by:
How do I remove an item with a specified value from an array? i.e. array values 1,2,2,5,7,12,15,21 remove 2 from array would return 1,5,7,12,15,21 (12 and 21 are NOT removed, duplicates are...
8
by: Mike S. Nowostawsky | last post by:
I tried using the "toUpperCase()" property to change the value of an array entity to uppercase BUT it tells me that the property is invalid. It seems that an array is not considered an object when...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
5
by: y | last post by:
Hi, I have an array with 2 elements and I would like to keep the elements but redimension the array so that I can add another value. How do I do this. I have tried this but, i think I have...
1
by: Kurt Lange | last post by:
HI, how to redimension an array in c#, and preserve it's contents (without using arraylist). In visual basic it... Dim I_interfaceArray() as I_interface = new I_interface() {objInterface} ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.