Explain some code.

Posted on 2006-10-30
Last Modified: 2010-04-16
Can you explain to me
what this section is doing? The override? The base(_id)

        #region Inherited members
        protected override Object CreateInstance(int _id)
            return new ReportTemplate(_id);

        public override DataSet DataSet
                VxDbClient _dbClient = SystemDBConnection.CreateSystemDbClient();
                DataSet _ds = _dbClient.ExecuteStoredProc("RG_sp_GetReportTemplates",
                    new VxDbParameter[] { new VxDbParameter(VxDbType.Sql, "@nvcFilter", "") });
                _ds.Tables[0].TableName = tableName;
                return _ds;

        public new ReportTemplate GetObject(int _id)
            return base.GetObject(_id) as ReportTemplate;

and this to
public class ReportTemplate : Object
        #region Attributes
        private string name;
        private string fileName;

        public ReportTemplate(int _id)
            : base(_id)

        #region Properties
        public string Name
                return name;

        public string FileName
                return fileName;

Question by:mathieu_cupryk
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

smidgie82 earned 500 total points
ID: 17834838
Hi mathieu_cupryk,

ReportTemplate is a class that's derived from the Object base class.  For every instance of ReportTemplate, there is an instance of class Object that's associated with it.  So, from within a member of ReportTemplate, "base" refers to the associate instance of class Object.  See the MSDN reference page on the base keyword:  Maybe more useful, Google for Object-Oriented programming.  Wikipedia has a good page on it:

>> public ReportTemplate (int _id) : base(_id)

This is a constructor.  Meaning that whenever an instance of ReportTemplate is created using the syntax:
ReportTemplate my_template (1);
an instance of ReportTemplate is created, and the integer "1" is passed to this constructor.  The base(_id) part is an instruction to use the Object (int _id) constructor of the Object base class, and to pass it _id as its argument.


Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL ( and MongoDB (…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question