private void button4_Click(object sender, EventArgs e) { string savePath = @"E:\test.xls"; ExcelOptions excelOptions = new ExcelOptions(); excelOptions.DeleteRows(savePath, 0, 1, -1);//删除前两行 }
private void button3_Click(object sender, EventArgs e) { ExcelOptions excelOptions = new ExcelOptions(); System.Data.DataTable dt = excelOptions.GetExcelData(@"E:\test.xls"); dataGridView1.DataSource = dt; }