自动将Excel文件复制到相同的目录和相同的文件名

我试图用c#导入一个Excel文件。 当我试图导入一个Excel文件正在创build一个新的Excel文件与导入文件相同的名称也新文件已损坏。 我不是为什么发生这种事。 我的代码:

private void button1_Click(object sender, EventArgs e) { //database name string table = "importing"; // Excel sheet name string excelQuery = "select * from [Sheet1$]"; try { //create connection strings string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\New folder (2)\\importing1.xls;Extended Properties=\"Excel 8.0;HDR=Yes;\";"; string sqlConnectionstring = "Data Source=LAB-2\\SQLEXPRESS;Initial Catalog=LMS;Persist Security Info=True;User ID=smart;Password=smart"; //To clear the previous data in the database string resetQuery = "delete from " + table; SqlConnection connection = new SqlConnection(sqlConnectionstring); SqlCommand cmd = new SqlCommand(resetQuery, connection); connection.Open(); cmd.ExecuteNonQuery(); connection.Close(); //copy data from the excel file OleDbConnection con = new OleDbConnection(connectionString); OleDbCommand cmdOLEDB = new OleDbCommand(excelQuery, con); con.Open(); OleDbDataReader dataReader = cmdOLEDB.ExecuteReader(); SqlBulkCopy bulkcopy = new SqlBulkCopy(sqlConnectionstring); bulkcopy.DestinationTableName = table; while (dataReader.Read()) { bulkcopy.WriteToServer(dataReader); } con.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }