Home
About
Contact
Login
Home
Code and Articles
Videos
Books
Search
Demos
Portfolio
Home
>
Categories
>
Code from a Category
Salesforce CRM (4)
VB.Net (85)
Zoho Invoice (1)
MSSQL (185)
Asp.net C# / VB (341)
SugarCRM (1)
CSS (10)
PHP (118)
jQuery (18)
Zoho Support (1)
Zoho Creator (7)
Zoho Mail (2)
Zoho CRM (58)
Other (12)
DotNetNuke (2)
Read and Write Excelsheet Data Using C#
User Name:
codelecturer
Name:
Mike Chauhan
Contact Me:
www.datawebcoder.com/ContactUs.aspx
Home Page:
www.datawebcoder.com
6 years of total IT experience including programming, application development, System Maintenance . 3 years of Experienced and expertise in .Net Framework VB, Visual Basic.Net, ASP.Net 2.0, 3.5 and AD...
[More]
Viewed Times:
746
Add Date:
01/03/2012
In this article we are going to see how to use an excel sheet as a source to load data in windows application or a web application and use the same to export back to the excel sheet using C# and VB.net.
This requirement is straight forward used in day-to-day activity, but most of the time end up messing in some section of the code.
Overview:
Normally when requirement comes with accessing the data from the excel sheet, we first choose to start with the office interop assemblies (Office Automation Assemblies) and make a connection to the excel sheet and start processing but it has some disadvantages using it over the web(Check this link for more details Issues). So the alternate option was to use the OLEDB Provider to read the data and use it for the front end with an additional parameter of passing the connection string to the excel sheet.
Now we consider that we have things ready to export and import data to the excel sheet and the data is available in a dataset or a data table. We can use the below code snippet's to get the data passed to and fro to the excel.
The Below code snippet will be used to export the data from local to EXCEL Sheet.
Code : Writing data to Excel sheet
Code : Reading data from Excel sheet
Conclusion:
So in this article we have seen on how to do small manipulation of reading and writing excel data using C# which we normally require in our day-to-day coding.
Reply above Post
Related Posts
Understanding and handling SQL Server Transaction Deadlocks.
Reading and Writing Cookies in ASP.NET and VB
Reading and writing to file using ASP.NET and VB.NET
DataReader and DataSet
Get a Random Row From a SQL Databse with ASP 4.0 and C#
Post a Comment
Name:
(Optional)
Email:
(Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Yes
No
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.