问题描述
大家好,
有人可以指导我迈出完美的一步,将mbd数据库中的数据填充到数据集中吗..?我已经搜索到谷歌,MSDN和其他论坛.结果仍然无法成功.我不知道为什么我从单独的类执行GetDataFromDB.并且还想通过使用SQL Query过滤将数据集值查看到datagridview中..
有人可以帮我吗?
Hi all,
Could someone instruct me to a perfect step in filled up data from mbd database into dataset..? I already search into google, msdn and other forum. The result still can''t success. I don''t know why. I perform a GetDataFromDB from separated class. And also want to view the dataset value into datagridview by filtered it with SQL Query..
Can someone help me?
推荐答案
Dim dt1 As New DataTable()
dt1.Clear()
Dim adp As New OleDb.OleDbDataAdapter("SELECT * FROM DatTime", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Alram.mdb")
adp.Fill(dt1)
adp.Dispose()
DataGridView1.DataSource = dt1
希望此COde对您有帮助... :)
在这段代码中,DateTime是我的表,而Alram.mdb是mdb文件....将此代码放入button_click事件.....
May this COde helps you......:)
In this code DateTime is my Table and Alram.mdb is the mdb file....put this code in button_click event.....
这篇关于将数据从mdb填充到数据集&在vb.net 2010中的gridview中查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!