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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

733 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