0

We are importing some data from an Excel file into SQL. For this we are reading Excel file using OleDbDataAdapter. We want to read filtered data of rows where there is some value in specific columns. We have written a query like following:

SELECT * FROM [Sheet1$]  WHERE  [F6] IS NOT NULL OR [F7] IS NOT NULL OR [F8] IS NOT NULL OR [F9] IS NOT NULL OR [F10] IS NOT NULL OR [F11] IS NOT NULL OR [F12] IS NOT NULL OR [F13] IS NOT NULL

This query works on some files, on some other files it gives an error saying - No value given for one or more required parameters.

I have tried several combinations but it is not working. Any help would be appreciated.

Thanks, Rahul Jain

1
  • Are you sure that the files where this query doesn't work have at least 13 columns? Commented Jun 17, 2018 at 14:09

1 Answer 1

1

I am able to solve it by including HDR=No in the connection string. Files which were not working had some values in first row.

Thanks everyone, Rahul

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.