https://blog.csdn.net/homechao/article/details/81207551?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control
https://blog.csdn.net/chongmu2584/article/details/100738740?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242
string cmd="SQL语句"DataSet RQ=new DataSet
//下面传递的参数中第二个是connection类型的SQL连接对象!
SqlDataAdapter run=new SqlDataAdapter(cmd,一个SQL连接)
QR.Fill(run)
Datagridview1.Datasource=RQ.Table[0].DefaultView
//此时datagridview中就是你查询出来的内容了
int index = this.dataGridView1.Rows.Add()this.dataGridView1.Rows[index].Cells[0].Value = Title
this.dataGridView1.Rows[index].Cells[1].Value=DateTime.Now.ToString()
this.dataGridView1.Rows[index].Cells[2].Value = Result
this.dataGridView1.Rows[index].Cells[3].Value = URL
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)