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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:32:54+00:00 2026-05-13T08:32:54+00:00

Assume I have a declared a datatable and to this datatable I have assigned

  • 0

Assume I have a declared a datatable and to this datatable I have assigned a result that gets returned from calling a stored procedure, so now, my datatable contains something like the following when accessing a row from it:

string name = dr["firstname"];
int age = (int)dr["age"];

if firstname is changed to first_name and age is removed, the code will obviously break because now the schema is broken, so is there a way to always keep the schema in sync with the code automatically without manually doing it? Is there some sort of meta description file that describes the columns in the database table and updates them accordingly? Is this a case where LINQ can be helpful because of its strongly typed nature?

  • 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-13T08:32:55+00:00Added an answer on May 13, 2026 at 8:32 am
    1. What about good old fashioned views that select by column name, they always output the columns with the specified names in the specified order. If the table underneath needs to change, the view is modified if necessary but still outputs the same as it did before the underlying table change – just like interfaces for your objects. The application references the views instead of the tables and carries on working as normal. This comes down to standard database application design which should be taught in any (even basic) data architect course – but I rarely see these actually used in business applications. In fact, the project I’m currently working on is the first where I’ve seen this approach taken and it’s refreshing to actually see it used properly.

    2. Use stored procs, if your table changes, modify the stored proc so the output is still the same – used in a similar manner to shield the application from the underlying table thus insulating the application from any table changes. Not sufficient if you’re looking to do dynamic joins, filters and aggregates where a view would be more appropriate.

    3. If you want to do it application side, specify the names of the fields you’re querying right in the query rather than using “select *” and relying on the field names to exist. However, if the field names on the table change, or a column is deleted, you’re still stuck, you’ve gotta modify your query.

    4. If the names of fields will change, but all of the fields will always exist, the content of those fields will remain the same and the fields will remain in the same order, you could reference the fields by index instead of by name.

    5. Use an object relational mapper as others have specified, but I don’t think this necessarily teaches good design rather than hopes the design of the framework is good enough and appropriate for what you’re doing, which may or may not be the case. I’m not really of the opinion this is a good approach though.

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

Sidebar

Related Questions

Assume I have this model : class Task(models.Model): title = models.CharField() Now I would
Assume that the int variables i and j have been declared, and that n
I have a filename declared like this; filename = Time.now.strftime(%H:%M:%S)+'.json' and the error occurs
Assume I have an enumerable object enum and now I want to get the
I'm working on a stored procedure that uses a cursor on a temporary table
Let us assume I have declared the variable 'i' of certain datatype (might be
I have a WPF DataGrid that has another datagrid declared within the RowDetailsTemplate; <DataGrid
Assume we have a button declared in XML : <button x:Class=A Content=click me Name=button
pstrjds, From the code you have provided I am trying to implement that code
I'm using VS2010, asp.net c#. I have a WebMethod declared like this [WebMethod(EnableSession =

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.