当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 我的操作系统是win 2000个人版,用adsl上网,可是经常出现这种情况---所有网页里的超链接都打不开了,比如新浪中,上面的大标题比如“体育”,“新闻”。。还可以打开,但是下面的具体的新闻内容就打不开了。。。所有网站都是如此!! 以前遇到这种情况,最后都是重做系统,才可以解决。。。但是最近又出现了,但这次好象重做系统也不行了,朋友说是染病毒了。。。但是是什么病毒,用什么杀毒软件管用呢?......
 ·majorvon()进来接分    »显示摘要«
    摘要: 如题! ......


RowFilter 中怎么把日期中的年拿出来过滤

DataTable   中有个日期字段,把大于某年的记录过滤出来?

NO.1   作者: saucer

 
  use  
   
  DataRow[]   drs=   DataTable1.Select("YourDateTime   >   1999-12-31");  
   
  or  
   
  DataRow[]   drs=   DataTable1.Select("YourDateTime   <   1999-01-01");  
   
  or  
   
  DataRow[]   drs=   DataTable1.Select("YourDateTime   >   #1999-12-31#");  
   
  or  
   
  DataRow[]   drs=   DataTable1.Select("YourDateTime   <   #1999-01-01#");  
   
 

NO.2   作者: xrll

用个笨方法,将日期列的年份提出来作为一个新列加在原数据表上:  
    DataColumn   myDataColumn=   customerTable.Columns.Add("year",   System.Type.GetType("System.Int"));  
        foreach(   DataRow   row   in   customerTable.Rows   )  
          {  
            row["date"]=   row["datetime"].Year;  
    }  
  然后.....  
  或用DataColumn.Expression设置表达式!


    摘要: 谢谢!! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE