如何通过适配器将数据从Access(mdb)导出到DataGridView? [英] How to export data from Access (mdb) to DataGridView through Adapter?

查看:67
本文介绍了如何通过适配器将数据从Access(mdb)导出到DataGridView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用以下代码将数据从访问(.mdb) - 表(名为TblAccQty)导出到datagridview(名为DataGridView1):

I wanted to export data from access (.mdb) - table (named as TblAccQty) to datagridview (named as DataGridView1) using code below:

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
        Me.TblAccQtyTableAdapter1.Fill(Me.Database1DataSet1.TblAccQty)
    End Sub




但是,当我运行表单时,没有数据(来自TblAccQty)导出到datagridview。我错过了什么?


杰森


However, when I run the form, that's no data (from TblAccQty) exported to the datagridview. Is there anything I missed?


Jason

推荐答案

你需要设置 DataGridView 的DataSource 属性:

You need to set the DataSource property of the DataGridView:

DataGridView1.DataSource = Me.Database1Dataset1.TlbAccQty





这篇关于如何通过适配器将数据从Access(mdb)导出到DataGridView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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