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 879395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:55:30+00:00 2026-05-15T11:55:30+00:00

I’m using VSTS 2K8 and I’ve set up a Unit Test Project. In it,

  • 0

I’m using VSTS 2K8 and I’ve set up a Unit Test Project. In it, I have a test class with a method that does a simple assertion. I’m using an Excel 2007 spreadsheet as my data source.

My test method looks like this:

        [DataSource("System.Data.Odbc", 
        "Dsn=Excel Files;dbq=|DataDirectory|\\MyTestData.xlsx;defaultdir=C:\\TestData;driverid=1046;maxbuffersize=2048;pagetimeout=5", 
        "Sheet1", 
        DataAccessMethod.Sequential)]
    [DeploymentItem("MyTestData.xlsx")]
    [TestMethod()]
    public void State_Value_Is_Set()
    {
        string expected = "MD";
        string actual = TestContext.DataRow["State"] as string;
        Assert.AreEqual(expected, actual);
    }

As indicated in the method decoration attributes, my Excel spreadsheet is on my local C:/ Drive. In it, the sheet where all of my data is located is named “Sheet1”.

I’ve copied the Excel spreadsheet into my project and I’ve set its Build Action = “Content” and I’ve set its Copy to Output Directory = “Copy if Newer”.

When trying to run this simple unit test, I receive the following error:

The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see “Troubleshooting Data-Driven Unit Tests” (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
Error details: ERROR [42S02] [Microsoft][ODBC Excel Driver] The Microsoft Office Access database engine could not find the object ‘Sheet1’. Make sure the object exists and that you spell its name and the path name correctly.

I’ve verified that the sheet name is spelled correctly (i.e. Sheet1) and I’ve verified that my data sources are set correctly.

Web searches haven’t turned up much at all. And I’m totally stumped.

All help or input is appreciated!!!!

  • 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-05-15T11:55:31+00:00Added an answer on May 15, 2026 at 11:55 am

    Change the “Build Action” property of Excel(.xlsx) to Content and “Copy to Output Directory” to Copy if newer.

    This worked for me when I got the same error as urs…

    ++ also dont forget to browse and add the excel file in Deployment tab of TestRun.config file that is in the server soution..:)

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

Sidebar

Ask A Question

Stats

  • Questions 483k
  • Answers 483k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This should solve the problem imho: document.body.innerHTML = document.body.innerHTML.replace( /ERROR:… May 16, 2026 at 7:01 am
  • Editorial Team
    Editorial Team added an answer Try it out: http://jsfiddle.net/5E3gs/ var $trs = $('#tableid tr'); for(var… May 16, 2026 at 7:01 am
  • Editorial Team
    Editorial Team added an answer Add to your, keeping existing elements, web.config: <compilation debug="true" strict="false"… May 16, 2026 at 7:01 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.