在程序中处理一下吧

  xlSheet.cell(1,1)="'" + ds.table[0].row[0]["id"]
加上"'"是为了让后面的自动转为字符串,你试试吧,我
这里没有这种情况

解决方案 »

  1.   

    还有有’号,我是用下而方法写的表
    fsobj = new FileStream(fileName,System.IO.FileMode.Create,FileAccess.ReadWrite);             
    //生成一个写入器
    _sw = new StreamWriter(fsobj,System.Text.UnicodeEncoding.Unicode); //写列标题
    if(showTitle)
    {
    for(int i=0;i<dt.Columns.Count;i++)
    {
    _sw.Write(dt.Columns[i].ColumnName+"\t");
    }
    _sw.Write("\r");
    } //写数据
    for(int i=0;i<dt.Rows.Count;i++)
    {
    for(int j=0;j<dt.Columns.Count;j++)
    {
    _sw.Write("'"+dt.Rows[i][j]+"\t");
    }
    _sw.Write("\r");
    }
      

  2.   

    declare @num = '0123'
    select  ('=''' + @num + '''') as aaa