title: Using Select query to display data in a data grid view
body: <p>I am trying to display a table data of my db in a DataGridView.here is my code</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e) 
  {              
    SqlConnection myConnection = new SqlConnection("Data Source=SHIRWANIPC;" + 
  "Initial Catalog=TEST DATABASE;" + "Integrated Security=True");
  
    myConnection.Open();
  
    SqlCommand objcmd = new SqlCommand("SELECT * FROM Customer", myConnection);
  
    SqlDataAdapter adp = new SqlDataAdapter(objcmd);
  
    DataTable dt = new DataTable();
  
    //adp.Fill(dt);
  
    DataGridView.DataSource = adp.Fill(dt);
  
  
  
  }
  </code></pre>
  
  <p>The code is not giving any error now but but it dosent display the data from my table in my grid ?</p>