title: Populate lists from database (SQLite)
body: <p>I'm trying to fill two lists with informations get on the database SQlite.</p>
  
  <pre><code>public class Investor // List
  {
      public int iID { get; set; }
      public string iName { get; set; }
      public string iDisplayName { get; set; }
      public string iArea { get; set; }
  }
  
  public class Area // List
  {
      public int aID { get; set; }
      public string aName { get; set; }
      public string aDisplayName { get; set; }
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>public class training : MonoBehaviour {
  
  public List&lt;Investor&gt; Investor()
  {
      var listOfInvestor = new List&lt;Investor&gt;();
  
      string conn = "URI=file:" + Application.dataPath + "/db_01.s3db";
      IDbConnection dbconn;
      dbconn = (IDbConnection) new SqliteConnection(conn);
      dbconn.Open(); 
      IDbCommand dbcmd = dbconn.CreateCommand();
  
      string sqlQuery = "SELECT * "+" FROM investor; SELECT * "+" FROM Area;";
      dbcmd.CommandText = sqlQuery;
      IDataReader reader = dbcmd.ExecuteReader();
  
  
  
      while(reader.Read())
      {
          var investor = new Investor();
  
          investor.iID = Convert.ToInt32(reader["i_id"]);
          investor.iName = reader["i_name"].ToString();
          investor.iDisplayName = reader["i_display_name"].ToString();
          investor.iArea = reader["i_area"].ToString();
  
          listOfInvestor.Add(investor);
      }
  
      reader.Close();
      reader = null;
      dbcmd.Dispose();
      dbcmd = null;
      dbconn.Close();
      dbconn = null;
  
      return listOfInvestor;
  
  }
  </code></pre>
  
  <p>I can get the second one fill, but that mean open twice the db and call another public List. </p>
  
  <p><code>public List&lt;Area&gt; Area(){}</code></p>
  
  <p>It's the only way ?</p>
  
  <p>Or maybe there is a way to do something like <code>Public List&lt;string&gt;[] LoadData() ?{}</code></p>