title: SQLite C# and DataGridView
body: <p>I have problem if I try to fill datagridview with data if i call function from another form. Everything work perfect if i call function in private void button1_Click in form2 where is datagridview but if i call function from another form (Form1) datagridview is empty .</p>
  
  <h2>Code in Form2 where is datagridview</h2>
  
  <pre><code>        public void fill_grid() {
          MessageBox.Show("Yuhuuuuuuu");
          form_Listusers form = new form_Listusers();
          SQLiteConnection cn = new SQLiteConnection(Form1.dbQuery); 
          cn.Open();
          string SQL;
          SQL = "SELECT users_id, name, username, place FROM users";
          SQLiteCommand cmd = new SQLiteCommand(SQL, cn);
          SQLiteDataAdapter da = new SQLiteDataAdapter(cmd);
          DataSet ds = new DataSet();
          try
          {
              da.Fill(ds);
              DataTable dt = ds.Tables[0];
              this.grid_userlist.DataSource = dt;
  
          }
          catch (Exception ex)
          {
              MessageBox.Show("Errrrrrrror");
          }
          cn.Close();
  
      }
  </code></pre>
  
  <p>Code in Form1 :</p>
  
  <pre><code>       Form2 frm = new Form2();
         frm.fill_grid();
  </code></pre>
  
  <p>I got Message "Yuhuuuuuuuu" but datagridview is empty.  </p>
  
  #
  
  <h2>SOLVED</h2>
  
  #
  
  <p>In Main Form (Form1) i set instance </p>
  
  <pre><code>Form frm_Listusers = new form_Listusers(); 
  </code></pre>
  
  <p>but after this:</p>
  
  <pre><code>form_Listusers frm_Listusers = new form_Listusers();
  </code></pre>
  
  <p>i can access to my function frm.fill_grid(); </p>