Datagridview.row.cell中的Datareader值添加 [英] Datareader value add in datagridview.row.cell

查看:137
本文介绍了Datagridview.row.cell中的Datareader值添加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在datareader中将查询传递为dr
我拿一个datagridview.
当数据读取器读取数据时,将dr的值一一添加到datagridview中.
当一行完成时,请添加新行.
再次dr的值在datagridview
中一个接一个地添加

I have passed a query in datareader as dr
I take one datagridview.
when data reader read data then one by one values of dr add in datagridview.
when one row completed then add new row.
again values of dr are one by one add in datagridview
How to do this ?

推荐答案

Dim da As New SqlDataAdapter(cmd)
Dim dt As New DataTable
da.Fill(dt)
MainForm.MyDataGridView.DataSource = dt
Dim ChkBox As New DataGridViewCheckBoxColumn
ChkBox.FlatStyle = FlatStyle.Standard
MainForm.MyDataGridView.Columns.Insert(1, ChkBox)


这篇关于Datagridview.row.cell中的Datareader值添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆