By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Recursive data grab in Excel - C#

codegecko
Expert 100+
P: 533
Hi guys,

I have an ASP.NET form that I'm building which makes use of a File Upload.
Great news - the file upload is working (using a random GUID for filename to avoid collisions).
Not-so-great news - I have to connect to this uploaded file (either XLS or CSV) and retrieve data from it to display in a GridView on the page.
I've successfully connected to it using ODBC and I'm using the GetSchema method to try and retrieve the worksheets but I'm getting 0 results returned.
Has anyone come across this problem before, and if so, how do I fix it?

Code PM'd upon request (not comfortable posting in public forum due to nature).

Cheers,

codegecko
Dec 15 '08 #1
Share this Question
Share on Google+
4 Replies


kenobewan
Expert 2.5K+
P: 4,871

codegecko
Expert 100+
P: 533
Thanks kenobewan for the link but I've already tried this one, OLEDB isn't available to me, I have to use an ODBC driver.
Dec 15 '08 #3

codegecko
Expert 100+
P: 533
Done it :-D

Turns out I was missing a couple of handy bits from my ODBC connection string - "Driver=790;DefaultDir=C:\PathToExcelFile;". This was stopping the ODBC driver from retrieving schema data.

I will produce an article on this at some stage to demonstrate how to manipulate Excel using ODBC (most examples demonstrate OLEDB only).

codegecko
Dec 15 '08 #4

kenobewan
Expert 2.5K+
P: 4,871
Well done! Look forward to the article :-).
Dec 17 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.