Type of the pointer of an instance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Dataset ds = new <Typed DataSet>

I want to get the actual type of the pointer (ds), and not the type of the instance being pointed to. In this case, the pointer ds is untyped, while the instance it points to is typed. What I need is to get the type of the pointer ds.

I tried with various methods in the type class, but in vain. How do I do that?
 
Hi Rakesh Rajan,

Eh, ds is a variable referencing a DataSet. It's not even a pointer, it's a pointer to another pointer pointing to something, in this case a DataSet object. To find out what ds is "pointing" to at any given moment you use

Type t = ds.GetType();
 
Rakesh Rajan said:
Hi,

Dataset ds = new <Typed DataSet>

I want to get the actual type of the pointer (ds), and not the type of the
instance being pointed to. In this case, the pointer ds is untyped, while
the instance it points to is typed. What I need is to get the type of the
pointer ds.

typeof( Dataset ) ?
 

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

Back
Top