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