Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

typecasting/converting in vb.net 1

Status
Not open for further replies.

mgriffith

MIS
Jul 3, 2001
177
US
anyone know of a way to do typecasting in vb.net?

in c# in c++ it's simple...if i want to convert an object i made called a "ParentDataType" to another i made called a "SpecializedDataType", i would just go

ParentDataType x = new ParentDataType();
SpecializedDataType y = (SpecializedDataType)x;


is there an easy way to do this using the System.Convert() class? the only thing i see is System.Convert.ChangeType() which expects a System.TypeCode parameter (which i don't think is the same thing that System.Type.GetType("SpecializedDataType")

thanks
mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
 
c#
(SpecializedDataType)x;

vb.net
ctype(x,SpecializedDataType)

:)
paul
penny1.gif
penny1.gif
 
thanks paul! i can't beleive i didn't see that [afro] mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top