p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET Website Programming Problem-Design-Solution (http://p2p.wrox.com/forumdisplay.php?f=23)
-   -   Help with DBObject base class (http://p2p.wrox.com/showthread.php?t=2709)

projectedNexus August 12th, 2003 10:44 AM

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);
    }

}



projectedNexus August 12th, 2003 06:36 PM

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



All times are GMT -4. The time now is 10:31 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.