Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 10-19-2006, 07:50 AM   #1
Red face Uploading Excel file into sql table


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
shalim is offline   Reply With Quote
Old 10-31-2006, 08:57 AM   #2
lahiruslk
Junior Member
 
Join Date: Oct 2006
Posts: 1
Default Reply with C#
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
lahiruslk is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46