title: Cannot display record to DataGridView in winforms
body: <p>This is what my table &quot;Item&quot; look like in my database:
  <a href="https://i.stack.imgur.com/Ie34d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ie34d.png" alt="enter image description here" /></a></p>
  <p>Now, I want to display it inside my winforms application. My application include the main page that look like this: <a href="https://i.stack.imgur.com/tQpKi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tQpKi.png" alt="enter image description here" /></a></p>
  <p>When I click the Store button, I expect the program will access the DataGridView inside UserControl1 that I have created and input all id, name and price from my database into it.
  This is how I make it inside the main view page:</p>
  <pre><code>string connectionString = @&quot;myconnectionString&quot;;     
  private void storeBtn_Click(object sender, EventArgs e)
      {
          
          userControl21.Hide();
          userControl11.Show();
          userControl11.BringToFront();
          using (SqlConnection sqlCon = new SqlConnection(connectionString))
          {
              sqlCon.Open();
              SqlDataAdapter sqlData = new SqlDataAdapter(&quot;SELECT * FROM \&quot;Item\&quot;&quot;, sqlCon);
              DataTable mytable = new DataTable();
              sqlData.Fill(mytable);
  
              UserControl1 uctl1 = new UserControl1();
              uctl1.storeGridView.AutoGenerateColumns = false;
              uctl1.storeGridView.DataSource = mytable;
  
          }
      }
  </code></pre>
  <p>I already also putting DataPropertyName inside my UserControl DataGridView the same name with the column i want to get record in my database. And when I run program, everything run and there's no bug occured, but when I click the &quot;Store&quot; button, nothing come out, there's no record displayed.
  I also try to debug step by step but still have no idea why it doesn't received any record. At this rate, I would really appreciate any help coming.</p>