This is the code that I'm using and keep getting a "An object reference is required for the nonstatic field, method, or property 'TheSolustion.Form1.aryReportList'":
In Form1 under
public class Form1 : System.Windows.Forms.Form{
public System.Array aryReportList;
public void BuildArray(string dept)
{
switch (dept)
{
case "accounting":
Array aryReportList=Array.CreateInstance( typeof(Object), 3, 2 );
aryReportList.SetValue("value",0,0);
aryReportList.SetValue("value",0,1);
aryReportList.SetValue("value",1,0);
aryReportList.SetValue("value",1,1);
aryReportList.SetValue("value",2,0);
aryReportList.SetValue("value",2,1);
break;
}
}
In the on click event
public void btnLogin_Click(object sender, System.EventArgs e)
BuildArray("accounting"

;
In Form2 I try to set the combobox DataSource like this:
this.comboBox1.DataSource = TheSolution.Form1.aryReportList;
What am I doing wrong?
Thanks