pass and retrieve values from dynamic 2D array

Hi guys,

I have created a 2D array dynamically using C#, and i want pass the values from sqlite database…now i want to insert string values to that array how can i retrieve values from that array?

Can any one say ans?

Thanks in advance.

If you’re using the ArrayList class, you’d use the Add() method to add string values and retrieve them thru indexing: myarray[0], myarray[1], etc. There is also an Insert() method if you wish to insert at an index.

Complete list of ArrayList members can be found here:

http://msdn.microsoft.com/en-us/library/system.collections.arraylist_members(v=VS.71).aspx

hi tonyd…

i have insert my values into database name as “testdata.db”(ie. am inserting a single string value). now it want to be store some variable after that i want to retrieve as a “2 dimensional array”, and the important fact it is dynamic array . so we couldn’t specify the index value… isn’t it?

then how we can store in a particular index… and we can simply stored using for loop.

eg. for(int i=0; i< n; i++)
{
for(int j=0; j< n; j++)
{
StringArray[i.j];
}
}
and now how can i retrieve these values using unity??

i hope you’ll get my ques…

Unfortunately, I don’t think I understand the question.

Are you asking how to properly access an sqlite database?

If so, I don’t know the answer (I don’t use SQL, it’s overkill for my needs), but it’s been discussed here several times, so a search for sql or sqlite would probably turn up something.

ok fine tonyd…its okay any way thanks for your reply

More on arrays, including 2D arrays, can be found here:

http://www.unifycommunity.com/wiki/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use%3F

How to connect to SQL database here:

http://answers.unity3d.com/questions/658/connect-to-the-sql-database