问题描述
有人请帮助我吗?
我有一个包含1个Tabel和2个查询的MS Access数据库。 />
例如
Tabel" client" ;:包含字段名称,地址,城市,州,ziip的客户
query1 allClient:从客户端选择*;
query2" SelectedClient" ;:从客户端选择*,其中名称为''%ab%'';
我在使用c#.net开发的应用程序中使用此数据库。
当我正在阅读表格客户时或query1" allClient"通过OleDbDataReader,它工作得很好。
但是当我使用与query2selectedClient相同的方式时虽然查询结果中有一些记录,但datareader是空的。查询在MS Access中工作得很好,但在我的应用程序中却没有。
谢谢,
Rajesh
Hi,
Will anybody please help me?
I have a MS Access Database with 1 Tabel and 2 queries.
e.g.
Tabel "client": Client containing fields name,address,city,state,ziip
query1 "allClient": Select * from client;
query2 "SelectedClient": Select * from client where name Like ''%ab%'';
And I am using this database from my application developed in c# .net.
When I am reading table "Client" or query1 "allClient" through OleDbDataReader it''s working perfectly.
But when I am using the same way with query2 "selectedClient" the datareader is empty eventhough there are some records in query result. The query is working nice in MS Access but not in my application.
Thanks,
Rajesh
推荐答案
你好mmccarthy,
我也试过''* ab *''但它仍然无法正常工作...
当我在MS Access中运行时,它的工作非常好......
例如Access" SelectedClient"中存在查询。 :从客户端选择*,其中名称为''* ab *'';
我再次从c#.net运行查询从SelectClient选择FName,LName它不起作用......
你能帮帮我吗?
问候,
Rajesh
Hi mmccarthy,
I tried like ''*ab*'' also but it''s still not working...
When i am running in MS Access it''s working very nice..
e.g. There is a query in Access "SelectedClient" : Select * from client where name Like ''*ab*'';
And again i am running query from c# .net "Select FName,LName from SelectedClient" and it''s not working...
would you please help me?
Regards,
Rajesh
这篇关于从C#.net调用Ms Access Query时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!