Author: anjaliagarwal5@yahoo.com | Posted on: 7/22/2010 6:01:23 PM | Views : 382

hello Everyone,
I have a list of files in excel spreadsheet. I want to open the excel spreadsheet and search for those files in c:\ directory and then copy those files from C:\ directory(whatever folder they are in) to another directory( C:\Test1). I already wrote the code to loop through the excel spreadsheet. Below is my code. Any help will be greatly appreciated.
private void button1_Click(object sender, EventArgs e) { try { OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:/Nitu/ArchivedReports3.xls;Extended Properties=Excel 8.0"); connection.Open(); DataSet ds = new DataSet(); string x = ""; OleDbDataAdapter myCommand = new OleDbDataAdapter(" SELECT * FROM [Sheet1$]", connection); myCommand.Fill(ds); co ...

Go to the complete details ...