Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,300 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 2,451 people online right now. Registration is fast and FREE... Join Now!




Specific selects from Excel through oledb

 
Reply to this topicStart new topic

Specific selects from Excel through oledb

DefiledDragon
18 Aug, 2008 - 07:49 AM
Post #1

New D.I.C Head
*

Joined: 18 Aug, 2008
Posts: 1

Hi All

I am currently attempting to read values from an excel spreadsheet to be manipulated in code and eventually stored in a db. My current select statement reads SELECT * FROM [sheet1$] and works just fine, however, the application I am writing will be operating asyncronously and there may be many instances open at once, all reading different spreadsheets. Because of this I am trying to limit my select statement in the event that somebody sends me 500 spreadsheets with 500 fields each when I only actually need 30 or so. So, I am trying to be specific in my select statement thus SELECT name, address1, address2 from [sheet1$] but when I execute this command through oledb I am getting a No value given for one or more required parameters OleDbException. If I replace my specified fields with * it works fine. I know the fields I am requesting exist as I created the spreadsheet myself. Does anybody have any ideas what might be going wrong?

TYIA

Paul

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 06:22AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month