Turing an Excel file streamed from an ASP web form into a DataSet on the server

I have built a web form in ASP.NET which uploads an Excel file to the server, and from there it's supposed to be transformed into a DataSet and the info dumped into the database.

However, I've got absolutely no idea how to turn a file stream into a DataSet, and I am loathed to actually copy the file onto the server and then use an ExcelConnection object, since uploading to the server has some security implications that I don't want to be responsible for.

So......

Can anyone help???

File Stream to DataSet???

I'd love to know!!!

Ged
gedmattAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Wow, I'd love to know, too :)  

There are methods for creating a DataSet from an XML file, but then you would have a similar problem with how to make the Excel file into an XML file.  

ADO.NET and the OleDb client needs a connection to a physical file to pull data into a dataset.

Bob
0
jj819430Commented:
ADO.NET and OleDB would definitely need to grab the actual file. Converting the stream seems like a rediculously hard solution. (Though I wouldn't rule it impossible)

If these clients are say, your employees or co-workers, why not build an add-in for excel.

When they need to upload they just have to click a button. You can have it report to a simple webservice, and instead of burdening your server with any transformations, you can burden each of the PCs.

Now if it is the case that you want to regularly upload without user involvement, just create a little app that runs in the background. Same advantages as above, but no need to have the users click a button. (SO LONG AS THEY LEAVE THE PC ON) - I had a comical bug in something like this thanks to environmentally friendly personnel

Now if they are simply anonymous people, you may not want to force them to download anything to work with your application. In that case you can minimize security risks by setting things up correctly.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gedmattAuthor Commented:
Fair enough, it looks like I'll have to physically upload the file and make sure I've performed full authentication to prevent any mis-use...

Cheers,

Ged
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.