I have the following code that I cannot figure out how to get to work:
namespace Project2
{
public static class Variables
{
public static List<string[]> tran1;
public static List<string[]> tran2;
}
}
private void Submit_Click(object sender, EventArgs e)
{
//Find the schedules
// Variables var;
string[] transaction;
transaction = new string[3];
string tran_num;
string read;
if (Tran1.Checked)
{
tran_num = "T1 ";
}
else
{
tran_num = "T2 ";
}
transaction[0] = tran_num;
if (Read.Checked)
{
read = "Read";
}
else
{
read = "Write";
}
transaction[1] = read;
transaction[2] = DATA.Text;
if (transaction[0] == "T1")
{
Variables.tran1.Add(transaction);
Transaction1.Text += "\n" + read + DATA.Text;
}
else
{
Variables.tran2.Add(transaction);
Transaction2.Text += "\n" + read + DATA.Text;
}
}
The following is the error that Visual Studio returns when I hit the Add Transaction step button
I am not sure what this error means, and being new to this language, not sure how to fix it.
Thank you for any possible help, or examples of how to fix this.