Sharing private member

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
 
R

Rain

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top