string fileName = @"C:\rhandx.xlsx"; string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Extended Properties=\"Excel 8.0;HDR=NO;\""; OleDbConnection con = new System.Data.OleDb.OleDbConnection(connectionString); con.Open(); OleDbCommand cmd = new OleDbCommand(); cmd.Connection = con; foreach (int coord in rhandlist) { cmd.CommandText = ("INSERT INTO TABLE [SHEET1$] VALUES (coord)"); cmd.ExecuteNonQuery(); } con.Close();
cmd.CommandText = ("INSERT INTO [SHEET1$] VALUES (coord)");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)