NetSir

Good Good Study,Day Day Up!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Text='<%# Eval("CoachPreTitle").ToString().Length >=14?Eval("CoachPreTitle").ToString().Substring(0,12)+"....":Eval("CoachPreTitle").ToString()%>'

或是直接在cs中写方法截取长度

我现在用的:

 public static DataSet RemindList(Int32 RemindYear)
        {
            DataSet ds = null;
            String sSql = "select a.RemindID,a.RemindTitle,a.RemindTime,a.RemindContent from (select RemindID,RemindTitle,RemindTime,RemindContent,(select datepart(year,RemindTime)  ) as RemindYear  from dbo.vwForWeb_Remind) a  where a.RemindYear="+RemindYear+" order by RemindID DESC ";
            ds = ULCode.XSql.MsSql.GetDataSet(sSql);
            ULCode.Data.XDataTable xdt = ULCode.XSql.XDS(ds);
            xdt.l("RemindTitle", 30);
            xdt.l("RemindContent", 46);
            ds = xdt.ToDataSet();
            xdt = null;
            return ds;
          
        }

l为字符串截取方法

posted on 2010-09-04 12:30  NetSir  阅读(215)  评论(0编辑  收藏  举报