.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

read xls file

Posted By: eswar     Posted Date: January 11, 2011    Points:2   Category :ASP.Net
how can i read xls file and then insert record into db

Responses
Author: Manas Patnaik             
Posted Date: January 11, 2011     Points: 5   

You can use Microsoft Excel Object Library at server.

Add reference to Interop.Excel.dll and Interop.Office.dll

Excel.Application objExl = = new Excel.Application();
Excel.Workbook objWb = objExl.Workbooks.Open(***inlclude the param**);
Excel.Sheets objSheets= objWb .Worksheets;
Excel.Worksheet objSheet= (Excel.Worksheet)objSheets.get_Item(1);


You can read the values in worksheet using WorkSheet object created above.


Manas Patnaik
http://manaspatnaik.com/blog


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend