title: Display query results in WPF Datagrid simplest way
body: <p>hi i tried the below code but not working to diaply query results on WPF data grid., any inpus pls.</p>
  
  <pre><code>using (SqlConnection sqlConn = new SqlConnection())
  {
      sqlConn.ConnectionString = connectionString;
      string queryString = "select * from dob.table_1";
      sqlConn.Open();
  
      DataTable table = new DataTable();
      SqlDataAdapter a = new SqlDataAdapter(queryString, sqlConn);
      a.Fill(table);
  
      this.datagird1.DataContext = table;
  }
  </code></pre>
  
  <p>Datagrid XAML:</p>
  
  <pre><code>&lt;DataGrid ItemsSource="{Binding}" AutoGenerateColumns="False" Grid.Row="1"
  Height="219" HorizontalAlignment="Left" Name="datagird1" VerticalAlignment="Top"
  Width="499" AllowDrop="True" /&gt;
  </code></pre>