how can an array, with its value intact be transferred from one function to another...?
What I have tried:
Step 1: First i created a class :- [ CrVw.cs]
Form containing okay button listbox combo box and AddTable button.
Step 2: In the form i just added the columns of the selected table to the
listbox selectedindexchanged event
step 3: In tthe AddTable button event
i selected the columns of the specified table in an array and displayed in a
msg box. Now how i will be able to transfer the content of the array to
another function... I did it thisway but without result
In the dataview.cs file
public void TransferViewData(string [,] args)
{
string [,] colHead=null;
colHead=args;
int h=colhead.GetLength(1);
for(int k=0;k<=5;k++)
{
for(int i=1;i<=h+1;i++)
{
if(colHead[k,i]==null)
{
nint=1; break;
}
else
{
var str22=colHead[k,i];
DGV.Columns.Add(str22,str22);
}
}
if(nint==1)
{
break;
}
}
}
step 4: In the Form load event of DataView.cs
i called transferDataView(CrVw.str);
// str is a static string array of two dimensions which can hold the data
provided by the CrVw.cs AddTable button.
Note : error ArrayIndexOutOfBounds.....because CrVw.str is null....why...?