Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用SQLite和C#/WPF创建计算_C#_Wpf_Sqlite - Fatal编程技术网

使用SQLite和C#/WPF创建计算

使用SQLite和C#/WPF创建计算,c#,wpf,sqlite,C#,Wpf,Sqlite,我正在开发一个小的时间管理应用程序(这样我就可以学习C#/WPF)。我需要知道将计算返回到我的表单上的各种文本块的最佳方法 我有一个名为“tblActivity”的表,我需要计算某些值存在的次数。在旧的VBA时代,我只会使用DSum或DCount,但我不确定返回此类数据的最有效/正确/最快的方式(字段按方式索引)。如果要查询整个表,请执行以下操作: int rowCount = tblActivity.rows.count(); 如果需要列满足某些条件的计数,请运行select语句 datar

我正在开发一个小的时间管理应用程序(这样我就可以学习C#/WPF)。我需要知道将计算返回到我的表单上的各种文本块的最佳方法


我有一个名为“tblActivity”的表,我需要计算某些值存在的次数。在旧的VBA时代,我只会使用DSum或DCount,但我不确定返回此类数据的最有效/正确/最快的方式(字段按方式索引)。

如果要查询整个表,请执行以下操作:

int rowCount = tblActivity.rows.count();
如果需要列满足某些条件的计数,请运行select语句

datarow[] SelectedIndexCountROw = tblActivity.select("Index = 12 AND Index2 = 'something'");
如果需要显示数据和计数,您还可以做什么

int COunt;
foreach row as datarow in tblActivity.rows
{
string ValueFromTable = row("Column");


//display data if you must,
COunt += 1;
}

谢谢你,Jonny-如果我想创建所有[Activities]=“Running”或“Siting”的计数,我只需要创建一个查询来返回值。就是这样:)祝你好运