public void WriteString(DataSet ds)
{     FileStream fs = new FileStream(@"c:\temp\test.txt" , FileMode.OpenOrCreate,    FileAccess.Write);  
   StreamWriter sw = new StreamWriter(fs);      sw.BaseStream.Seek(0, SeekOrigin.End);     foreach(DataRow dr in ds.Tables[0].Rows)
   {
     sw.WriteLine(dr[0].ToString()+" "+dr[1].ToString());  
   }   sw.Flush();  
}  
 

解决方案 »

  1.   

    好象你行了??   麻烦再看看............
           Waiting...............................................
      

  2.   

    这儿有一个直接从数据库导出的
    先应付老板EXEC master..xp_cmdshell 'bcp "Select  * from 数据库..表" queryout "c:\\kk.txt" /c /S"数据库" /U"用户名" /P"秘码" /t"\t" /r"\n"'
      

  3.   

    zxbyhcsdn(沙子 
    的方法很直接....
    但不符合你的要求///
      

  4.   

    vivianfdlpw() ( ) 信誉:100 
    的研究哈就搞定了