How to insert data to Excel file using OLEDB
In the previous examples we used Microsoft Excel 12.0 Object Library for read or write to and Excel file . In C# without using Excel Object we can insert , edit , delete , select etc. in cell content of an Excel file using OLEDB .
You have to import System.Data in the project for doing these operations . For add new content in the cell or insert a new content , We can use the INSERT command like in SQL Operations.
sample UPDATE sql
sql = "Insert into [Sheet1$] (id,name) values('5','e')"
The following picture shows before and after update of the Sheet.
- How to create Excel file in C#
- How to open an Excel file in C#
- How to read an Excel file in CSharp
- How to format an Excel file using C#
- How to insert a picture in excel from C# App
- How to insert a background picture in excel
- How to create Excel Chart from C#
- How to export excel chart from C#
- How to excel chart in C# picturebox
- C# data validation input box in excel file
- Read and Import Excel File into DataSet or DataTable
- How to update data in Excel file using OLEDB
- How to export databse to excel file
- How to export DataGridView to excel file