Data structure in Window Form
<p>I got this problem that I don't understand how it works
when I run the program, Form1 supposes to get the result from mysql.Select() and saves that inside the list. And it supposes to turn on the MessageBox, but it doesnot. So I comment out list =mysql.Select(), then it works. What causes that problem? 
Mysql_schedule is a different class. 
thanks</p>

<pre><code>     public List&lt;String&gt;[] list;
     MySql_Schedule mysql = new MySql_Schedule();
     private void Form1_Load(object sender, EventArgs e)
     {
       loadData();
     }

     public void loadData()
     {

        list = mysql.Select();
        MessageBox.show("testing");
            for (int i = 0; i &lt; dataGridView1.RowCount; i++)
            {
                //insert IDs
                dataGridView1[0,i].Value = "1";// list[0][i];
                //insert Names
                dataGridView1[1,i].Value = "testing"; //list[1][i];
            }     

     }
</code></pre>

<p>here is my select function in myslq_schedule</p>

<pre><code>public List &lt;string&gt; [] Select()
{
    string query = "SELECT id,name,weekday,description FROM employee e INNER JOIN     schedule s ON e.id=s.id";

    //Create a list to store the result
    List&lt;string&gt;[] list = new List&lt;string&gt;[4];
    list[0] = new List&lt;string&gt;();
    list[1] = new List&lt;string&gt;();
    list[2] = new List&lt;string&gt;();
    list[3] = new List&lt;string&gt;();

    //Open connection
    if (this.OpenConnection() == true)
    {
        //Create Command
        MySqlCommand cmd = new MySqlCommand(query, connection);
        //Create a data reader and Execute the command
        MySqlDataReader dataReader = cmd.ExecuteReader();

        //Read the data and store them in the list
        while (dataReader.Read())
        {
            list[0].Add(dataReader["id"] + "");
            list[1].Add(dataReader["name"] + "");
            list[2].Add(dataReader["weekday"] + "");
            list[3].Add(dataReader["description"] + "");
        }

        //close Data Reader
        dataReader.Close();

        //close Connection
        this.CloseConnection();

        //return list to be displayed
        return list;
    }
    else
    {
        return list;
    }
}
</code></pre>
