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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:44:51+00:00 2026-05-20T19:44:51+00:00

I have an object with following attributes Books ———- ID , Name Now, I

  • 0

I have an object with following attributes

Books
----------
ID , Name

Now, I want to return an object for a gridview in presentation layer which has a lot more attributes then the original object

Gridview Object
--------------- 
ID, Name, Quantity, Location, ISBNNO, LastIssued

I don’t have any business object composed of these attributes currently & I don’t want to create it just for the sake of a gridview.

How do I create & return custom
objects like these on the fly ? I am
new to DTO’s. Can someone give me an
example to return a DTO inside my DAL
?

Thanks,
Damien.

  • 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-20T19:44:52+00:00Added an answer on May 20, 2026 at 7:44 pm

    if you don’t want to mess with your database objects, create a decorator for it

    public class myGVObject
    {
        public Book { get; set; }
    
        public int Quantity { get; set; }
        public string Location { get; set; }
        public string ISBNNO { get; set; }
        public DateTime LastIssued { get; set; }
    }
    

    and in your gridView use:

    <asp:Label id="lblBookId" text="<%# Eval("Book.ID") %>" />
    <asp:Label id="lblLastIssue" text="<%# Eval("LastIssued") %>" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Object called Person which has the following attributes; id , name
I have some JS code which generates the following object, return { type: some
I have following object: var myObject = { attributes: { name: dev.pus, age: 29
Suppose we have a MBean that has the following attributes and operations. Attributes: name
I have 2 objects with attributes as the following: Object 1: Person Name Location
I have the following XML array: [link]=> array(2) { [0]=> object(SimpleXMLElement)#311 (1) { [@attributes]=>
I have the following object defined function BusinessUnit(id, name, code) { this.id = ko.observable(id);
I have an object with the following properties GID ID Code Name Some of
I Have a object which the following field : boost::unordered_map<std::string, std::shared_ptr<Foo> > m_liste_; I
Hi I have the following object: Hashtable<Object, Double> and I want to find the

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.