Last post Nov 04, 2008 12:09 PM by mukkuonline
Mar 05, 2008 12:19 AM|Sagarvirani|LINK
I want to integrate an EXCEL sheet with the ASP.NET 2.0 and then want to insert the data from it into the database MSSQL 2005.
Mar 05, 2008 01:00 AM|r_nassabeh|LINK
You can connect to an excel sheet with Ado.Net's OleDbConnection. All you need is to set the connection string correctly (something like "Provider=Microsoft.Jet.OleDb.4.0; data source= MyFile.xls; Extended Properties=Excel 8.0;". Then you can read data by
executing SqlCommands, and reading it into a DataReader or a DataSet. Having the data you can eighter show it on the page or insert it in another database that can be SQl Server.
You can find an example on
Mar 05, 2008 01:04 AM|Sagarvirani|LINK
Thanks for the reply.
I want a blank excel sheet to be displayed to the user and the user will enter the data into the sheet and the data from the sheet should be then transferred to the database in appropriate tables. This should happen every time when the application is activated.
Can u help me on this.
Mar 05, 2008 01:06 AM|Sagarvirani|LINK
I want a C# code if possible.
Mar 05, 2008 01:06 AM|Spanco|LINK
1.create a reference in your project to Excel 9.0 Object library
2.Declare a Excel Application Object. For example:
private Excel.ApplicationClass() ExcelApp = null;
ExcelApp = new Excel.ApplicationClass();
3.In your program, using this Object to process Excel file.
Excel.Workbook outBook = ExcelApp.Workbooks.Add(Excel.XLWBATemplate.xlWBATWorksheet);
Excel.Worksheet TheSheet = (Excel.Worksheet)outBook.Worksheets;
.......set your datagride to the excel file
4. Write to excel file
TheSheet.Cells[rowCount, column] = yourValue;
Mar 05, 2008 01:25 AM|Spanco|LINK
Go thru the article u got what u want
Mar 05, 2008 01:33 AM|Sagarvirani|LINK
Thanks for the reply. In my application the EXCEL sheet will be displayed to user who will insert some data and then save it. On save the data in it will be inserted into the database. So the main
issue for me is to display the blank excel sheet to the user every time the application is active. please help me on this if possible.
Nov 04, 2008 12:09 PM|mukkuonline|LINK
I read your answer and I like that. Can you please help me?I need to display the Excel application(one worksheet) in my aspz page which has some filters. I m unable to find the code. Please reply how can i display excel spreadsheet in my aspx page.
Thanks & Regards