Type of the pointer of an instance

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?
 
M

Morten Wennevik

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();
 
S

Stu Smith

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

Similar Threads

Stack vs heap 12
About DataTable.Roes.Find 1
Get the type of Enum 2
Get rid of some of the options in 2008 4
Untyped DataSet as datasource in Reportviewer 0
Snowflake to SSIS 0
about understanding 4
DataSet 1

Top