使用string.format  函数, where后面的语句最为占位符,再调用dal方法的时候 给一个参数,例如,string sql = string.format("select   省略.......  from  table where {0}",param);param 为条件语句,根据需要拼接。 

解决方案 »

  1.   

     public DataTable GetData()
            {
                return new GzrzDAL().GetData();
            }我bll里是这样的窗口里是
    public void BindDGV()
            {
                GzrzBLL getdb = new GzrzBLL();
                this.dgv.DataSource = getdb.GetData();
             }怎么给呢
      

  2.   

    给方法传参 不会??GetData(param)   往下传递,知道执行sql的方法。
      

  3.   

    两个参数或者一个string数组或者一个字符串都可以。
      

  4.   

    a.kssj between param and param1
    GetData(param,param1)
    是这样吗?where {0}",0指啥意思哪order by放在那里不好意思都是很菜的问题
      

  5.   

    当前日期加1天:dadeadd(day, 1, getdate())
    当前日期加1月:dadeadd(month, 1, getdate())
      

  6.   

    duanzi_peng 按照他这么说我该怎么做呢
      

  7.   

    前日期加1天:dadeadd(day, 1, getdate())
    当前日期加1月:dadeadd(month, 1, getdate())