dataGridView 绑定SQL数据

来源:互联网 发布:java零基础到项目实战 编辑:程序博客网 时间:2024/04/26 07:36

 SqlDataAdapter da1 = new SqlDataAdapter(“sqlstr”,cn);

DataSet ds1 = new DataSet();
                da1.Fill(ds1);
                dataGridView1.DataSource = ds1.Tables[0];
                cn.Close();

0 0
原创粉丝点击