MS访问查询不返回c#.net中的行 [英] MS access query not returning rows in c#.net
本文介绍了MS访问查询不返回c#.net中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
这一定是一个非常简单的问题,但我无法解决。
我写了一个ms在C#.net项目中访问查询以检索行。
即使没有错误,也没有检索到行。
这是我的代码:
OleDbConnection xsconn = new OleDbConnection();
xsconn.ConnectionString = @ Provider = Microsoft.ACE.OLEDB.12.0;数据源= D:\\ \\\mail.accdb跨度>;
xsconn.Open();
string qto = SELECT [NAMES] FROM + var_name + WHERE [STATUS] ='to';
OleDbDataAdapter da = new OleDbDataAdapter(qto,xsconn);
DataSet ds = new DataSet();
da.Fill(ds);
我在VB.net上做了很多次流利的同样的练习成功..这对我来说是一种失望.. !!
我尝试过:
我复制了我的代码。
由于没有错误,我无法解决它。
解决方案
问题解决了。
为什么我的文本框有& lt; div& gt; ......& lt; div& gt;标签? [ ^ ]
这是帮助我的链接。我正在使用MS Access 2013.最初我为数据格式选择了长文本。当我将其更改为短文本时,数据周围没有更多div标签。
感到放心.. !!
谢谢。 。!!
Hi All,
This must be a very simple problem but I am unable to solve it.
I have written an ms access query within C#.net project to retrieve rows.
Even though there are no errors, rows are not getting retrieved.
Here is my code:
OleDbConnection xsconn = new OleDbConnection();
xsconn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0; Data source=D:\\mail.accdb";
xsconn.Open();
string qto = "SELECT [NAMES] FROM " + var_name + " WHERE [STATUS]='to'";
OleDbDataAdapter da = new OleDbDataAdapter(qto, xsconn);
DataSet ds = new DataSet();
da.Fill(ds);
I have done the same exercise in VB.net many a times fluently & successfully..so this is kind of disappointment to me..!!
What I have tried:
I have copied my code in question.
Since there are no errors, I am clueless how to solve it.
解决方案
Problem solved.
Why does my text box have <div> ...... <div> tags?[^]
This is the link that helped me. I am using MS Access 2013. Initially I chose long text for data format. When I change it to short text, there was no more div tags around data.
Feeling relieved..!!
Thank you..!!
这篇关于MS访问查询不返回c#.net中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文