Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / March 2008

Tip: Looking for answers? Try searching our database.

Inheritance Trouble

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cfps.Christian - 06 Mar 2008 21:24 GMT
I created an application that had its own database access class
library loaded with objects.  I've now created another application
that needs a DBA library that uses some of the same objects as the
other.  I created the application, the second DBA and referenced the
original DBA in the second.

When I go to use inherited objects in my application I can only see
the properties that I created in the directly referenced class
library.  Will I have to reference the original library in my
application or am I missing something simple here?

Sample Code:

<serializable()> _
public class AStudent

   private _strName as string

   public sub new()
   'blah blah
   end sub

  public property Name as string
      get
         return _strName
      end get
      set(value as string)
         _strName = value
     end set
   end property
end class

<serializable()> _
public class Student 'in the library directly referenced by the app
     inherits AStudent 'In original class library

   private _iID as integer

   public sub new()
   'blah blah
   end sub

  public property ID as integer
      get
         return _iID
      end get
      set(value as integer)
         _iID = value
     end set
   end property
end class

The application cannot see the property "Name" in "AStudent".
Cor Ligthert[MVP] - 07 Mar 2008 04:14 GMT
Yes you should set a reference to the DLL where Name is in.

Cor

>I created an application that had its own database access class
> library loaded with objects.  I've now created another application
[quoted text clipped - 49 lines]
>
> The application cannot see the property "Name" in "AStudent".
cfps.Christian - 07 Mar 2008 14:03 GMT
That worked, I was hoping that pure inheritance would traverse that
gap as well but I guess my hopes were crushed.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.