取Dropdonlist中年和月的值进行查询就行 了。

解决方案 »

  1.   

    关键是SQL语句怎么写呀,大侠!
      

  2.   

    string sql="select * from table1 where Datepart(y,thedate) = "+dropdownlist1.selectedvalue+" and Datepart(m,thedate)="+dropdownlist2.selectedvalue;
      

  3.   

    Month(****)>"+myMonth+" and
    Year(****)>"+myYear+"
      

  4.   

    补充说明:table1查询数据表,thedate查询的字段~~~
      

  5.   

    感谢各位,刚查了一下Datepart()函数,string sql="select * from table1 where Datepart(y,thedate) = "+dropdownlist1.selectedvalue+" and Datepart(m,thedate)="+dropdownlist2.selectedvalue;对上面的Datepart(m,thedate)看的还不是太明白,不好意思,太菜了!
      

  6.   

    Datepart(m,thedate) 是 月份
    Datepart(y,thedate) 是 年份