Filling a multi-dimentional array

R

rkmoray

I have created a Multi Dimentional array, but having problems filling
it.

int mCount=0;
mCount=ds.Tables[0].Rows.Count;
string[,,] arrayppsa = new string [mCount,1,1];

DataTable myDataTable=ds.Tables[0];
foreach(DataRow myDataRow in myDataTable.Rows) {

//Tried thsi to fill, lots of errors
arrayppsa[x,1,1]= myDataRow["0"].ToString() ,
myDataRow["1"].ToString(), myDataRow["2"].ToString();
 
M

Marina

Of course that is an error - the assignment statement is for 1 slot in a 3
dimensional array. You are trying to somehow assign it 3 values by using
comma separated values? That doesn't even really make logical sense, since
how would you assign 3 values to one cell in an array.

rkmoray said:
I have created a Multi Dimentional array, but having problems filling
it.

int mCount=0;
mCount=ds.Tables[0].Rows.Count;
string[,,] arrayppsa = new string [mCount,1,1];

DataTable myDataTable=ds.Tables[0];
foreach(DataRow myDataRow in myDataTable.Rows) {

//Tried thsi to fill, lots of errors
arrayppsa[x,1,1]= myDataRow["0"].ToString() ,
myDataRow["1"].ToString(), myDataRow["2"].ToString();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top