gridview导出数据,如果为0开头,丢失0解决方案

1、protected void GridView1_RowDataBound( object sender, GridViewRowEventArgs e )
  {
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
      e.Row.Cells[1].Attributes.Add("style", "vnd.ms-excel.numberformat:@;");
    }
  }

2、在字符串的数据前面加多个'号,SELECT '''' + GWR AS Expr1  FROM T

posted @ 2013-12-20 23:20  山清石玉  阅读(380)  评论(0编辑  收藏  举报