[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


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

Posted on 2004-11-01
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 150 total points
ID: 12469924
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.


Accepted Solution

jj819430 earned 225 total points
ID: 12470147
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

ID: 12470914
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...



Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

656 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