Sharing private member

  • Thread starter Thread starter Morten Snedker
  • Start date Start date
M

Morten Snedker

Namespace ImportProducts

Public Class ImportProducts

Private ht As New Hashtable
Private dt As New DataTable
Dim count As Integer = 0
...


The private dt above, I wish to be accessable from another class:

Namespace ImportProducts
Public Class ProductGroup
...

How should the dt be declared for this to be possible? And how should it
be called (I'd prefer it to be just directly accesable) ?


Kind regards /Snedker
 
If you want this to be accessable from 'anything' external to the class,
then you need to decalre it public.

This is not normally a good idea. Normal practice would be to declare a
property which can return the value.


public Hashtable Ht { get { return ht; } }
 
Back
Top