数据适配器vb.net [英] data adapter vb.net

查看:102
本文介绍了数据适配器vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些数据存储在MS Access数据库中,我试图使用vb.net作为任务进行搜索.无论如何,我有一个称为库存管理的表,但是当我尝试从vb运行代码时却说找不到文件等?需要帮助

这是我正在运行的代码:

I have some data stored in a MS access database and im trying to search using vb.net as a task. Anyway i have a table called stock management but when i try to run code from vb it says cant find file etc? Need help

Here is the code im running:

Sub cdb(ByVal ds As DataSet)
        'this establishes connection to db'
        sql = "SELECT * FROM Stock Management"
        con = New OleDbConnection(cs)
        con.Open()
        da = New OleDbDataAdapter(sql, cs)
        da.Fill(ds, "Stock Management")
        maxr = ds.Tables("stockmanagement").Rows.Count




da.Fill(ds, "Stock Management")在这里说找不到文件?有什么问题?




da.Fill(ds, "Stock Management") here is where it says cant find the file? Whats the problem?

推荐答案

可以尝试
sql = "SELECT * FROM 'Stock Management'"


sql = "SELECT * FROM [Stock Management]"


这篇关于数据适配器vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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