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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:46:19+00:00 2026-05-22T14:46:19+00:00

In the past, I’ve generally used classes to represent my data in applications I

  • 0

In the past, I’ve generally used classes to represent my data in applications I design and build. But in web applications, that doesn’t seem to be needed/applicable, because data is stored in a database, and things like DataSet work great for retrieving and saving data.

I currently work with ASP.NET, and the data-bound controls (such as GridView) seem to like to bind to SqlDataSource, ObjectDataSource, DataView, etc. So, given a static MyDB class that pulls a DataSet out of the database, my data-oriented page code often essentially looks like this:

DataSet employeeData = MyDB.GetData();
DataView dvEmpData = new DataView(employeeData);
grdData.DataSource = dvEmpData;
grdData.DataBind();

Thus I don’t generally have data classes to correspond to my database schema. But new developments like POCO and the EF Framework endorse creating and using those classes. What is the advantage of this? My ideas are:

  • Compile-time errors where misspellings would have otherwise gone unnoticed until runtime. employeeData[0].Rows[i]["Name"] is not as nice as employees[i].Name where employees is an IEnumerable<Employee>
  • In C# 3 and later, ability to use LINQ and cool extension methods on IEnumerable<T> to filter data collections flexibly instead of having to create/change a stored procedure or query in the database for every aggregation/selection I need to do.
  • Source code is easier to keep under SCM than database stuff, which means keeping more logic in the source code is better.
  • A guy like me who learned CS doing local applications is more comfortable 🙂

On the other hand, converting data to .NET classes before putting them onscreen is a step that will take computational time, and is not strictly necessary. And I’ve got a feeling that GridView and its compatriots will prefer binding to DataView over IEnumerable<T>. Also, the database is going to be faster at querying and aggregating data than LINQ.

What is the reasoning behind the approach endorsed by POCO? Have I covered it here, or am I missing something?

  • 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-22T14:46:20+00:00Added an answer on May 22, 2026 at 2:46 pm

    To answer your specific question concisely:

    Utilizing business objects allows you to execute logic on data in a memory more efficiently than in SQL or in an ad-hoc fashion in multiple locations.

    • Example: Need to setup a URLRewrite when a page name changes? One central location for this is clearly ideal.

    However…

    You can rule out most negatives by using LINQ to SQL or, in more complex cases, other ORM’s such as the Entity Framework or nHibernate.

    Read Part 1 and Part 2 of Scott Gu’s blog on LINQ to SQL for some inspiration on the subject.

    • With LINQ to SQL, you get the benefits without the drawbacks (that you mentioned), plus a few extra benefits.

    And yet…

    In situations where you don’t need that sort of non-trivial logical — you may as well use a SQLDataSource and bind directly to a Gridview; however, LINQ to SQL is so simple that many prefer it even in the simplest of cases.

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

Sidebar

Related Questions

In the past, I used swiftsuspenders that is an actionscript 3 IoC controller. Basically
For past 7 months I have been designing web applications using open source technologies
in past I have used fbml rendering but now there is to many update
In the past I've used svn and cvs, but never BitBucket or Git. I
In past I use dynamic sql and datatable to get data from database. Such
From past few days I'm trying to develop a regex that fetch all the
In past years I have learned the most important languages for web development (CSS,
The past week or two I've been studying Maven, and I like it, but
My past CI experience is tightly coupled with CC.Net, but for sake of innovations
In the past I have seem a couple of people say C+ (with just

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.