![]() |
|
|
|
#1 |
|
Dear all,
I am developing a web application, with one sub web page is to upload excel file into sql data table using FileUpload control The scenario is as below : 1. User clicks on browse button of the FileUpload control and selects the excel file to upload in the local pc 2. The file name is captured and saved into a Dataset. 3. The Dataset is Bound to a Gridview to show the worksheet of the excel file 4. Then the user press button to upload the file to sql table in server How can I implement this scenario using ASP.NET (VS2005) and VB script Thanks for any response shalim |
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Oct 2006
Posts: 1
|
try
{ Excel.Application excelObj = new Excel.Application(); string workbookPath = "c:/dbExcel/25-10-2006.xls"; Excel.Workbook theWorkbook = excelObj.Workbooks.Open(workbookPath, 0, true, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false); Excel.Sheets excelSheets = theWorkbook.Worksheets; string currentSheet = txtsheet.Text.ToString().Trim() ;//"Sheet1" Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet ); Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range(txtcol.Text. ToString().Trim(),txtrow.Text.ToString().Trim());//("A2", "A2") Label1.Text = excelCell.Value2.ToString(); } catch (Exception ex) { Label1.Text = ex.ToString(); } lahiruslk |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SONY DVD RW DW-G120A SOMETIMES FAILS...... | atlantic965 | DVD Video | 0 | 06-18-2006 10:36 PM |
| problems backing up dvds | Lawrence Traub | DVD Video | 11 | 09-27-2005 07:34 PM |
| Re: Ripping DVDs. Please answer the attached question. - Question.txt | Stan Brown | DVD Video | 19 | 02-09-2005 11:19 PM |
| Burn process failed - help! Log file posted for help troubleshooting | Michael Mason | DVD Video | 1 | 08-16-2004 09:24 PM |
| Pioneer A05 Problems | Bill Stock | DVD Video | 8 | 11-28-2003 05:03 AM |