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

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

how to store a excel sheet into database,and how to retrieve?

Posted By: teja     Posted Date: October 08, 2013    Points:5   Category :C#
hi i have one excel sheet with employees details like sal,desg,.....
with 100 employees.i want to store this excel sheet(having 100 emp details) into database.After storing into database,i want to retrieve the details of employee seperatly,if i enter empid as 123 then i want to retrieve that employee details from excel sheet,can any one please help me how to retrieve it?

Author: Sagar Pardeshi             
Posted Date: November 06, 2013     Points: 20   

Ref the following url:


Author: Ashutosh Jha             
Posted Date: December 05, 2013     Points: 20   

You can follow the below link. I have used it and it worked for me. Just what you need to change in the solution is -just replace image to your excel sheet file.


Ashutosh Jha

Author: hark             
Posted Date: March 30, 2014     Points: 20   
Author: gorge             
Posted Date: April 25, 2014     Points: 20   

how about core code provides by Spire.XLS.DLL
//load an excel file 
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"..\excel.xls", ExcelVersion.Version97to2003);
//get the count of excel worksheet
int sheetCount = workbook.Worksheets.Count;
Random r = new Random();
int index = r.Next(0, sheetCount);
//show datatable in datagrid
Worksheet sheet = workbook.Worksheets[index];
DataTable dataTable = sheet.ExportDataTable();
DataView view = new DataView(dataTable);
this.dataGrid1.ItemsSource = view;
this.dataGrid1.AutoGenerateColumns = true;

More details regarding data export from excel to database :http://www.e-iceblue.com/Knowledgebase/Spire.XLS/Program-Guide/wpf-excel-export-export-data-from-excel-to-datatable-for-wpf.html

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

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