datagrilview C#
datagrilview控件如何绑定数据库?求代码
[解决办法]
SqlConnection conn = new SqlConnection("Data Source=(local);Initial Catalog=StunetSystem;Integrated Security=True");
conn.Open();
string sql ="select * from TbShInDetail ";
SqlDataAdapter ad=new SqlDataAdapter(sql,conn);
DataTable dt=new DataTable();
ad.Fill(dt);
dataGridView1.DataSource=dt;
[解决办法]
+1,最直接的一种