Code and Articles
Code from a Category
Salesforce CRM (4)
Zoho Invoice (1)
Asp.net C# / VB (341)
Zoho Support (1)
Zoho Creator (7)
Zoho Mail (2)
Zoho CRM (58)
Read and Write Excelsheet Data Using C#
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...
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.
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
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
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
(Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment 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.
CONNECT WITH US
Copyright 2009-2011. All rights reserved
WEBSITES WE RECOMMEND: