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

Posted on 2004-11-01
Last Modified: 2010-04-15
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.


Can anyone help???

File Stream to DataSet???

I'd love to know!!!

Question by:gedmatt
    LVL 96

    Assisted Solution

    by:Bob Learned
    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.

    LVL 7

    Accepted Solution

    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.

    Author Comment

    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...



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now