Forum Moderators: open

Message Too Old, No Replies

Uploading Excel into Dataset

         

Argblat

9:02 pm on Dec 1, 2006 (gmt 0)

10+ Year Member



I would like to be able to allow the user to upload (using the classic text box / browse button combination) an excel file, which the server will read into memory (not save to disk) and convert into a DataSet and further parsed in code.

I'm having a lot of trouble accomplishing this task, mostly because I don't have much experience with file uploading in .NET (I'm using VS.NET 2003 and ASP.NET 1.1.x).

Does anyone have any knowledge they can share with me? I would greatly appreciate some insight

Thank you,
Mike

Argblat

9:03 pm on Dec 1, 2006 (gmt 0)

10+ Year Member



I forgot to mention that I'm working in C#

-Mike

TheNige

1:47 am on Dec 6, 2006 (gmt 0)

10+ Year Member



Basically, you'll upload the file to the server, which you made need to store temporarily. Then use the OLEDB connection object and the Jet database driver to connect to the Excel spread sheet. You should then be able to access the data in the spread sheet and import it to a dataset.

Do some Google searches for this...personally, I've dones this and it isn't very fun.

Argblat

8:50 pm on Dec 6, 2006 (gmt 0)

10+ Year Member



TheNige,

Thats exactly what I've set up. It seems like a waste of a step to actually save the Excel to the hard disk, convert it to a DataSet, and delete it ... but I couldn't figure out a way to do it straight from memory

Thanks
-Mike