title: How to show data in datagridview without using database
body: <p>I want to show data in datagridview without using Database. In my UI there are 3 fields in which I inserted values and want to show them in data grid view when I execute the program it is not giving any error nor showing any values in datagridview.</p>
  
  <p><img src="https://i.stack.imgur.com/un5JP.png" alt="Picture"></p>
  
  <pre><code>   private void Submit_Click(object sender, EventArgs e)
      {
          DataRow dr = dt.NewRow();
          dr[0] = txtBox1.Text;
          dr[1] = txtBox2.Text;
          dr[2] = txtBox3.Text;
          dataGridView1.DataSource = dt;
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          dt = new DataTable();
          DataColumn dc1 = new DataColumn("Name");
          DataColumn dc2 = new DataColumn("Email");
          DataColumn dc3 = new DataColumn("ConatctNumber");
          dt.Columns.Add(dc1);
          dt.Columns.Add(dc2);
          dt.Columns.Add(dc3);
          dt.Rows.Add(dc1);
          DataRow dr = dt.NewRow();
          dataGridView1.DataSource = dt;
      }
  </code></pre>