<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6" -->

---
title: Data Driven Testing in Visual Studio 2008 - Part 1
description: A walkthrough of data driven unit testing in Visual Studio 2008, showing how to generate a unit test for a simple Calculator class and bind it to a database...
canonical: https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Data Driven Testing in Visual Studio 2008 - Part 1 | daily.dev
og:description: A walkthrough of data driven unit testing in Visual Studio 2008, showing how to generate a unit test for a simple Calculator class and bind it to a database...
og:url: https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6
og:image: https://api.daily.dev/og/posts/VeorbTqM6.png
og:image:alt: Data Driven Testing in Visual Studio 2008 - Part 1
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Driven Testing in Visual Studio 2008 - Part 1

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 4 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of data driven unit testing in Visual Studio 2008, showing how to generate a unit test for a simple Calculator class and bind it to a database table using the DataSource attribute so the same test runs repeatedly against different rows of input and expected values. Covers sequential vs random data access, and previews a follow-up post applying the same technique to web tests.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2008-02-12-data-driven-testing-in-visual-studio-2008-part-1>

## Questions this post answers

### How do I bind a unit test to a database so it runs once per row in Visual Studio 2008?

Add a DataSource attribute to the test method specifying the provider, connection string, and table name, then read values from TestContext.DataRow using column names like a, b, and expected. Visual Studio runs the test once per row in the table, either sequentially or randomly depending on the DataAccessMethod setting, and reports pass/fail per row.

_Developers wiring up data-driven test suites can find practical setup walkthroughs like this on daily.dev._

## Similar posts on daily.dev

- [Today I will… improve test coverage](https://daily.dev/posts/today-i-will-improve-test-coverage-9ytnrgshc) · DevBlogs · 2 upvotes · 1 comments
- [Testing ASP.NET Core Web API: WebApplicationFactory and Integration Tests](https://daily.dev/posts/testing-asp-net-core-web-api-webapplicationfactory-and-integration-tests-8chotq6j5) · We Are .NET · 1 upvotes · 0 comments
- [More Realistic Tests with In-Memory Databases ASP.NET Core](https://daily.dev/posts/more-realistic-tests-with-in-memory-databases-asp-net-core-wctbbhdk6) · Telerik · 0 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#c#](https://daily.dev/tags/c#), [#visual-studio](https://daily.dev/tags/visual-studio)

[View this post on daily.dev](https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Data Driven Testing in Visual Studio 2008 - Part 1","url":"https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6"},"datePublished":"2026-10-04T13:06:36.889Z","dateModified":"2026-10-04T13:19:45.122Z","description":"A walkthrough of data driven unit testing in Visual Studio 2008, showing how to generate a unit test for a simple Calculator class and bind it to a database...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/89cdbee007e16f90c58e78b183188bbc?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/89cdbee007e16f90c58e78b183188bbc?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,c#,visual-studio","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"Data Driven Testing in Visual Studio 2008 - Part 1"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/data-driven-testing-in-visual-studio-2008---part-1-veorbtqm6#faq","mainEntity":[{"@type":"Question","name":"How do I bind a unit test to a database so it runs once per row in Visual Studio 2008?","acceptedAnswer":{"@type":"Answer","text":"Add a DataSource attribute to the test method specifying the provider, connection string, and table name, then read values from TestContext.DataRow using column names like a, b, and expected. Visual Studio runs the test once per row in the table, either sequentially or randomly depending on the DataAccessMethod setting, and reports pass/fail per row. Developers wiring up data-driven test suites can find practical setup walkthroughs like this on daily.dev."}}]}
```

