用 BCP 或 BULK INSERT  详细 请看Sql Server 联机丛书

解决方案 »

  1.   

    using System.IO;
    StreamWriter wr = new StreamWriter(Server.MapPath("文件名"),false);
    wr.Write(时间值+内容);
    wr.Flush();
    wr.Close();
      

  2.   

    FileStream fsobj=new FileStream(Path,System.IO.FileMode.Create,FileAccess.ReadWrite);
    StreamWriter _sw=new StreamWriter(fsobj,System.Text.UnicodeEncoding.Unicode);
    _sw.Write(时间值+内容);
    _sw.close();
    fsobj.close();
      

  3.   

    this.dt.Clear();
    this.dt = this.IA.ReturnChoose("SW_PMSALBON","");
    if(this.textBox1.Text.Trim() =="")
    {
    MessageBox.Show("转账文件路径不能为空,请输入");
    this.textBox1.Focus();
    return;
    }
    try
    {
    if(File.Exists(this.textBox1.Text))
    {
    DialogResult r = MessageBox.Show ( "文件已经存在,是否要重新生成!" , "生成转账文件!" , MessageBoxButtons.YesNo , MessageBoxIcon.Question ) ;
    if (DialogResult.Yes ==r)
    {
    File.Delete(this.textBox1.Text);
    }
    else
    {
    return;
    }
    }
    }
    catch(System.Exception ex)
    {
    MessageBox.Show("文件路径格式输入错误,请确认!");
    return;
    }
    StreamWriter writer = null;
    try
    {
    writer = new StreamWriter(this.textBox1.Text,true);
    foreach(DataRow dr in dt.Tables[0].Rows)
    {
    writer.WriteLine(dr[0].ToString()+dr[1].ToString());
    }
    MessageBox.Show("已经成功的生成了转账文件,请查看"); }
    catch(IOException E)
    {
    MessageBox.Show("读写文件错误");
    e.ToString();
    }
    finally
    {
    if (writer != null)
    writer.Close();
    }
      

  4.   

    //导出完毕,显示出来记事本
    if(File.Exists(this.textBox1.Text))
    {
    System.Diagnostics.Process.Start(this.textBox1.Text);
    }