public DataSet SelectRegInfo(string CardId, string DeptName, DateTime StarTime, DateTime EndTime)//提示有错误
        {
            try
            {
                string mySql = "Select pat.CardId 医保卡号,pat.Name 病人姓名,dept.DeptName 科室名称,reg.RegisterFee 挂号费用,reg.RegisterTime 挂号时间 FROM SysPatInfo pat,SysDeptInfo dept,SysRegisterInfo reg where pat.CardId=reg.CardId and dept.DeptId=reg.DeptId";
                if (CardId != "")
                {
                    mySql += " and CardId='" + CardId + "'";
                }
                if (DeptName != "")
                {
                    mySql += " and DeptName='" + DeptName + "'";
                }
                mySql += " and RegisterTime between '" + StarTime + "'and '" + EndTime + "' order by CardId";
                dbc.DataBaseConn_R(mySql);
            }
            catch (Exception)
            {
                return null;
            }
        }
把方法内的内容注释掉,还是有错误,咋搞的?
希望各位前辈指导一下。