本文介绍了在C#ms访问中获取值= 0的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Guys,我正面临一个问题,即我写的地方不是[columnname] = 0但是当我得到它的价值时,列= 0
请查看我的代码并告诉我这个问题的解决方案
谢谢
我尝试过:
Hello Guys, i am facing a problem that is i write where not [columnname] = 0 but when i get so it's getting value where column = 0
please look my code once and tell me the solution of this problem
Thanks
What I have tried:
con_string.ConnectionString = @"Provider = Microsoft.ACE.OLEDB.12.0;Data Source =|DataDirectory|\Restaurant.accdb;Persist Security Info=False";
con_string.Open();
DataSet dsa1 = new DataSet();
DataTable dt1 = new DataTable();
dsa1.Tables.Add(dt1);
OleDbDataAdapter da1 = new OleDbDataAdapter();
da1 = new OleDbDataAdapter(string.Format("SELECT [column3] As [Tables],count(Tables) As [QTY] from [Total] Where [column3] like 'DineIn%' Or [Date] Between #{0}# And #{1}# Or not [column1] = 0 Group By [column3]", DateTime.Now.ToShortDateString(), DateTime.Now.AddDays(1).ToShortDateString()), con_string);
da1.Fill(dt1);
con_string.Close();
int sum1 = 0;
for (int i = 0; i < dsa1.Tables[0].Rows.Count; ++i)
{
sum1 += Convert.ToInt32(dsa1.Tables[0].Rows[i][1].ToString());
}
Dinein_Orders.Text = sum1.ToString();
推荐答案
这篇关于在C#ms访问中获取值= 0的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!