现写的一段代码.力求做到最简单了.呵呵.贴进去就可以用
SqlConnection conn = new SqlConnection("Server=.;uid=sa;pwd=sa;database=Northwind");
conn.Open();
SqlCommand cmd = new SqlCommand("select * from employees", conn);
SqlDataReader dr= cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
conn.Close();