473,608 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Excel File After Upload to Web Server Memory

Using a web form with an input field of type "file", is there a way to
upload an Excel .XLS file into the web server's memory, access a sheet, and
copy the data into an ADO.NET DataSet without saving the .XLS file to the
server's hard drive? In other words, access the .XLS file while it's in the
server's memory as if it resided on the hard drive.

Thank you !!
Jack H.
Nov 17 '05 #1
3 4044
I think you can save it to disk, read it to memory, then delete it.

Jack Harrington wrote:
Using a web form with an input field of type "file", is there a way to
upload an Excel .XLS file into the web server's memory, access a sheet, and
copy the data into an ADO.NET DataSet without saving the .XLS file to the
server's hard drive? In other words, access the .XLS file while it's in the
server's memory as if it resided on the hard drive.

Thank you !!
Jack H.


--
bill
e-mail: bi*****@hotmail .com
MSN Messenger: bi*****@hotmail .com
Web: http://www.minivoice.com

Nov 17 '05 #2
Hi,

Hi, you can use "Request.Fi les[0].InputStream" to read the file content
into byte array and update the data set.

refer to :
support.microso ft.com/default.aspx?kb id=308042

Dim ds As DataSet = New DataSet()
pAdapt.MissingS chemaAction = MissingSchemaAc tion.AddWithKey
pAdapt.Fill(ds, "UploadTabl e")

Dim row As DataRow
row = ds.Tables("Uplo adTable").NewRo w()

byte[] arrByte = new byte[Request.Files[0].InputStream.Le ngth] ;
Request.Files[0].InputStream.Re ad(arrByte,0,
(int)Request.Fi les[0].InputStream.Le ngth);

row(0) = Request.Files[0].FileName
row(1) = arrByte

ds.Tables("Uplo adTable").Rows. Add(row)
pAdapt.Update(d s, "UploadTabl e")
pConn.Close()
Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
Here are some links that can help you:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp
http://www.aspose.com/Products/Aspose.Excel/
http://officewriter.softartisans.com/

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Jack Harrington" <jh***********@ cox.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Using a web form with an input field of type "file", is there a way to
upload an Excel .XLS file into the web server's memory, access a sheet, and copy the data into an ADO.NET DataSet without saving the .XLS file to the
server's hard drive? In other words, access the .XLS file while it's in the server's memory as if it resided on the hard drive.

Thank you !!
Jack H.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12368
by: Vikram | last post by:
Hi, Given below is my task. An user can open the xls file from my website (loaded on the top frame). After filling the Excel, he can click a send button at the bottom frame. By clicking the button i have to save the file in a shared directory on the web server by a unique name. Is it possible ?
6
2045
by: no one | last post by:
I need to find a way to upload an Excel file into an MS SQL database using a web control front end. I have my ASP.Net control (using C#) uploading a file to a directory, but the server people now tell me that I cannot have a writeable area for the web and have a DTS see it as this is too much of a security risk. So, I need a way to read the file directly into the database. I've no idea how to do this. Does anyone have ideas? I know...
0
4184
by: Mike Knight | last post by:
(I've also posted this problem on microsoft.public.excel.programming) I have a MS Access 2003 Database named "AS400 Fields.mdb". This database contains links to tables on an AS400. In MS Excel 2003, I have VBA code that creates and executes queries using the Access database, and returns the results to an Excel sheet. The first time the query is executed, results are returned to Excel in usually less than 10 seconds. However, if the...
2
12704
by: Sreedhar Vankayala | last post by:
Hi, I joined a project where we need to import data from a excel file into sql server via the asp.net. After doing a long research found that #1. Upload Excel file to the server #2. Load or keep the Excel file into the memory #3. Query the excel file and convert into insert queries and execute them via sql server
6
6751
by: Daniel | last post by:
Hi all, Can i open and edit the excel sheet on web page after downloading? After editing, i close the web page and the excel file auto upload to the server. Is it possible? I really struggling about the ability. If not, what advice can u provide? thank you in advance. ur help will be appreaciated.
5
6569
by: Seok Bee | last post by:
Dear Experts, I currently trying to use the FileUpload control from asp.net 2.0 to upload files. The uploading of the file I would like to store it in the Access Database. Unfortunately, I've no idea how I can do that. Can anyone provide me some solution by writing the code in vb.net? Many thanks in advance. Regards,
1
3263
by: Adrian Turner | last post by:
I am just starting developing with .Net(Have used asp for years). I have created a very simple upload page which once uploaded opens the file(excel) and displays the data. If I Attempt to re-run using the same file I get the message 'Error: The process cannot access the file because it is being used by another process. ' VS 2005 Here is my code, any suggestions...
9
3824
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web site for a small club I belong to and one of the features I would like to include is the ability to allow users to upload image files. unfortunately the servers web root www folder only allows READ and EXECUTE permissions, which makes it...
1
2845
by: =?Utf-8?B?TGFtaXM=?= | last post by:
HI, I am doing an aspx application and need to let my users be able to edit the information in my database by the page. My first Idea was to let them export the information to an excel file at local machine where they can edit it och then upload the file by the page again to save down their changes down to the database. Now, this is the code I am using to Upload from sql to excel : HttpResponse response = HttpContext.Current.Response;
0
8509
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8493
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8365
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4053
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2493
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1363
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.