为什么这个sql语句不起作用 [英] Why doesn't this sql statement work

查看:72
本文介绍了为什么这个sql语句不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用以下代码时遇到了困难。当我运行它时,我得到一个零长度表,但如果我从第三个文本框中复制sql语句进入访问并将其粘贴到sql视图并运行它我得到我正在寻找的一条记录。

I am having difficulties with the following code. When I run it I get a zero length table but if I copy the sql statement out of the third text box go into access and paste it into the sql view and run it I get the one record I’m looking for.

展开 | 选择 | Wrap | 行号

推荐答案

我从未见过一个未命名的表查询返回一个表名。摆脱,日志)部分并使用

dAdapter.Fill(dSet);


注意:你如果你只返回一个表,也可以只填充DataTable而不是DataSet。
Well I''ve never seen an unnamed table query return a table name. Get rid of the , "Log") section and use
dAdapter.Fill(dSet);

Note: You can also fill just a DataTable instead of a DataSet if you only are returning one table.


如果我改变了那么我该如何改变第20行以从数据集中取回信息。除了我的代码工作正常,如果我发表评论
If I change that then what do I change line 20 to to get the information back out of the dataset. Besides My code works fine if i comment out
展开 | 选择 | Wrap | 行号


您的ad hoc sql
Your ad hoc sql
展开 | 选择 | Wrap | 行号


这篇关于为什么这个sql语句不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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