title: Adding an item to list string[]
body: <p>I am trying to add a few rows I got from a DataTable to my list using this struct:</p>
  
  <pre><code>protected struct roleProperties
  {
      public string roleName { get; set; }
      public string[] functionTitle { get; set; }
  }
  </code></pre>
  
  <p>As you can see I want more strings inside the method <code>Title</code> string</p>
  
  <p>I have been trying to do it like this:</p>
  
  <pre><code>public void getRoleFuncs(int roleId)
  {
      List&lt;roleProperties&gt; roles = new List&lt;roleProperties&gt;();
      int i = 1;
  
      SqlParameter ro_id = new SqlParameter("@ro_id", roleId);
      string q = "SELECT ro_name, fu_title FROM roles INNER JOIN rolefunctions ON roles.ro_id = rolefunctions.fk_role_id INNER JOIN functions ON rolefunctions.fk_func_id = functions.fu_id WHERE ro_id = @ro_id";
      SqlDataReader r = gm.returnReader(q, ro_id);
      while (r.Read())
      {
          roleProperties item = new roleProperties();
          item.roleName = r["ro_name"].ToString();
          foreach (IDataRecord str in r)
          {
              item.functionTitle[i] = r["fu_title"].ToString();
              i++;
          }
          roles.Add(item);
      }
  }
  </code></pre>
  
  <p>But I get a null reference on this line:</p>
  
  <pre><code>item.functionTitle[i] = r["fu_title"].ToString();
  </code></pre>
  
  <p>Can anyone see what I am doing wrong?</p>