here is the code
private void button1_Click(object sender, RoutedEventArgs e)
{
DataTable dt = new DataTable();
string constring = "Data source=----------\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;";
using (SqlConnection con = new SqlConnection(constring))
{
con.Open();
string cmdstring = "select * from emp";
using (SqlCommand cmd = new SqlCommand(cmdstring, con))
using (SqlDataAdapter adp = new SqlDataAdapter(cmd))
adp.Fill(dt);
}
grid_emp.ItemsSource = dt.DefaultView;
}
when clicking on button output is looking like this..