http://www.cnblogs.com/daview/archive/2004/05/06/8375.aspx

解决方案 »

  1.   

    用存储过程啊!!
    在程序直接用的sql语句一般都是很简单的查询语句,稍微复杂一点或者带参数输入的最好用存储过程来做。
      

  2.   

    1。统计所有性别为女的销售员的数量:
    table.Compute("Count(*)","Sex=0");2。统计所有销售员中年龄大于20岁的
    table.Compute("Count(*)","Birthday<'"+today);//today为今天的日期字符串3。统计销售产品的平均价格
    table.Compute("Aver(Price)","true");4。统计产品代码为1的产品销售数量:
    table.Compute("Sum(Quantity)","ProID=1");
      

  3.   

    ds.tables[0].Compute(string strExpression,string strFilter)
      

  4.   

    平均年龄=table.Compute("Aver(年龄)","true");
      

  5.   

    tables.Compute(string strExpression,string strFilter);
      

  6.   

    tables.Compute()生成的数怎么不能用做数据原,那位在说说看怎样才能做数据愿呀