Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 12th, 2003, 10:44 AM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with DBObject base class

I have added the code for the DBObject base class as instructed and now I am trying to write a psuedo data and business class that inherits from it just to get familiar with how this works.

As you can see below, I am declaring a public class named "Class1" that inherits from DATA.DataComponents.DBObject (DBObject has identical code to that in the book). I then write a psuedo method (for testing purposes only) called "RunProc", which in turn calls on DBObject's "RunProcedure" method. Everything up to this point works great.

Then, I declare "Class2" a psuedo Business class which instantiates a "Class1" object as "test". Intellisense picks up DBObject's constructor signature and I plug in fake params. The problem is, that when I take my new Class1 "test" object and try to call its new "RunProc" method, Intellisense does not see "RunProc". In other words, nothing happens after type test and dot.

What am I doing wrong here?

- - - -

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DATA
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    public class Class1: DATA.DataComponents.DBObject
    {
        public Class1(string newConnectionString) : base(newConnectionString)
        {}
            public void RunProc(string procName,params1,rows)
            {
                base.RunProcedure(theProc,params1,rows);
            }


    }


    public class Class2
    {
        DATA.Class1 test = new Class1(ConfigurationSettings.AppSettings["BocaConnectionString"]);

        //Try to use test's method:

                test.RunProc(string procName,params1,rows);
    }

}


  #2 (permalink)  
Old August 12th, 2003, 06:36 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I figured it out. I was abstracting an extra layer.



Similar Threads
Thread Thread Starter Forum Replies Last Post
DbObject class rsbst23 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 December 25th, 2004 08:41 PM
Adding Page_Load to base class doesn't work Raeldor BOOK: ASP.NET Website Programming Problem-Design-Solution 2 September 24th, 2004 06:30 AM
Base Class for Code-Behind Problem groupmatch BOOK: ASP.NET Website Programming Problem-Design-Solution 3 September 8th, 2004 05:06 AM
classes :: base class is inaccessible .... Kaliste C# 3 July 16th, 2004 04:56 AM
base class inheritance krunch97 VB.NET 2002/2003 Basics 6 April 23rd, 2004 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.