Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7891111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:32:03+00:00 2026-06-03T06:32:03+00:00

I am trying to read data from an excel sheet but there is an

  • 0

I am trying to read data from an excel sheet but there is an exception saying that no value given for one or more required parameters which I don’t understand. Here is my code upto where the error is pointing to:

Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection _
    ("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\Staff Contracts.xlsx; Extended Properties=""Excel 12.0;HDR=NO""")
MyCommand = New System.Data.OleDb.OleDbDataAdapter _
    ("select * from [Staff Contracts$A4:K14] where I=176", MyConnection)
MyCommand.TableMappings.Add("Table", "TestTable")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)

The exception points to that last line MyCommand.Fill(DtSet) which shows me that there is a problem with my select statement. Previously my code reads the data and displays it without the where clause in the select but when I added the where statement so that it can only read data from rows where the column I has a value equal to 176, it instead gives an exception that shows that some required parameter is missing a value

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:32:04+00:00Added an answer on June 3, 2026 at 6:32 am

    In case of HDR = NO, I column will become F9 because oledb will name the column F1.. Fn for it’s internal reference.

    MyCommand = new System.Data.OleDb.OleDbDataAdapter("select * from [Staff Contracts$A4:K14] where F9=176", MyConnection);
    

    In this case the OLEDB driver will create columnnames for each column in the selection (F1 to Fn). so if you change the range “A4:K14” to “B4:K14” then column F9 will be F8.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to read data from an Excel sheet using Office.Interoperability.Excel namespace. I'd like
I'm trying to read data from excel (xls) sheet. I'm running Windows 7 64-bit,
I am trying to read data from excel file in asp.net. I have added
Are there any special considerations trying to read up data from an HTML form
I'm trying to read data from an Excel document in C# using Microsofts COM
i am trying to read in some data from an excel: If (FileUpload1.PostedFile.ContentType =
I am trying to read data from excel files using datatable. The command select
I am trying to read data from the given web page using Java. public
I'm trying to read data from the registry @ SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\ The return value I
I'm trying to read data from csv file, but instead of e.g. 001000 I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.