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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:17:56+00:00 2026-05-16T01:17:56+00:00

I have a .NET class (for discussion, ClassA) that calls a SQL Server stored

  • 0

I have a .NET class (for discussion, ClassA) that calls a SQL Server stored procedure (for discussion, fooSproc), processing the results with a SqlDataReader. The rows are processed, and the columns are referenced using the name of the column in the returned result set. For example, where dr is the SqlDataReader, something like dr[“column_foo”].

Now, say, for example, that a someone checks in a change to ClassA such that it is looking for column_bar in the result set returned by fooSproc. However, that person neglected to check in a change to fooSproc such that it would actually return column_bar.

The problem: the code compiles, but fails at runtime due to the missing column.

Is there a way to make this scenario cause a build error to be generated? Naturally a build verification/acceptance test makes sense here, but it’s cheaper to catch it earlier. Please pretend that even a superficial code review is out of scope.

  • 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-16T01:17:57+00:00Added an answer on May 16, 2026 at 1:17 am

    I’m not really aware of any way to do that using just .Net and SQL, as your code would have to be connected to your db at compile time.

    That is, when you build your code, it would have to have access (right then) to the db, and try to parse your queries. VS doesn’t do that. Linq-to-SQL and Entity Framework might get you closer, but I don’t think they’d even be able to help with your specific scenario (a change to a stored procedure).

    You might be able to create something using .NET SMO (Sql Management Objects), but even that would need to be connected to the db to do any good… The underlying problem seems to be that you need to check that a Stored Procedure still returns what it did when it was originally written, and I don’t think SQL provides that kind of data in any easilly accessable form (other than just looking at the proc).

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

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • 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 I would advise against using the backspace key, since that… May 17, 2026 at 9:02 am
  • Editorial Team
    Editorial Team added an answer (Note: I'll assume that by "decode and dispatch" you mean… May 17, 2026 at 9:02 am
  • Editorial Team
    Editorial Team added an answer Non static properties (alias fields, alias member variables) have their… May 17, 2026 at 9: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

Related Questions

I have a .NET class library containing a class with a method that performs
if i have a .net 1.1 class that inherits from DictionaryBase and i am
I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on
I have a class 'Database' that works as a wrapper for ADO.net. For instance,
I have a .Net 3.5 class library project that I've migrated to use Visual
I have created an ASP.NET class. In that class i would like to use
Say I have a .NET class like so: public class Person { public string
I have a .NET 3.5 web application for which I have implemented a class
I have some ASP.NET web services which all share a common helper class they
I have created a class library in VB .NET. Some code in the library

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.