时间类型用between好像不包括两端的吧
解决方案 »
- 求大侠发发《编程之美——微软技术面试心得》
- [求助]后台用InnerHtml所控制标签的样式以及js问题
- 为什么Image中的图像不显示?
- 在用户本地机上创建文件?
- 在线等待结果,ASP.net生成XML文件
- 请问一下在ORACLE中如何取到刚插入的数据的自增列的值
- 正在学web自定义控件,如何写一个继承自label 的控件呢?想请教。
- 索引超出范围。必须为非负值并小于集合大小。参数名: index
- MVC4 ViewBag在<script>中出现乱码
- (新手)如何读数据库中某个字段的值?
- ##急救啊!把Datagrid中的数据导入Excel出现乱码,在线等。。。
- ~高分相送~怎样将本周的数据显示出来 按访问量排序
DataRow[] dr = objDataView.Table.Select( "your condition" );
当时间为'2003-10-13 17:00:00:00'的success_num数据有三个,
在SQL事件分析器里执行上面的SQL语句后,在SQL事件分析器里的结果是这样的:
datetime success_num
2003-10-13 16:00:00:00 6.0
2003-10-13 16:00:00:00 7.0
avg
6.5
datetime success_num
2003-10-13 17:00:00:00 1.0
2003-10-13 17:00:00:00 2.0
2003-10-13 17:00:00:00 3.0
avg
2.0
可是在页面上的datagrid里只显示了:
datetime success_num
2003-10-13 16:00:00:00 6.0
2003-10-13 16:00:00:00 7.0这是怎么回事啊?
另外,我如何得到
avg
6.5
datetime success_num
2003-10-13 17:00:00:00 1.0
2003-10-13 17:00:00:00 2.0
2003-10-13 17:00:00:00 3.0
avg
2.0
这些数据啊???
这里的"your condition"写什么呢?
比如我想得到
avg
6.5
难道我写:"avg(success_num)"?
这样好象不行啊。
help me!!!
可是那怎么获得
avg
6.5
这个值呢?
如:
string strDS;
//Get data from the first table in the collection
foreach(DataRow myRow in dtc["table1"].Rows)
{
strDS = myRow[0].ToString();
strDS = myRow[1].ToString();
}
//Get data from the second table in the collection
foreach(DataRow myRow in dtc[1].Rows)
{
strDS = myRow[0].ToString();
}
//Get data from the third table in the collection
foreach(DataRow myRow in dtc[2].Rows)
{
strDS = myRow[0].ToString();
strDS = myRow[1].ToString();
}
//Get data from the fourth table in the collection
foreach(DataRow myRow in dtc[3].Rows)
{
strDS = myRow[0].ToString();
}