Anyway to convert an object type using a System.Type?

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Is there anyway to convert an object from one type to another using either a
System.Type object containing the desired type to convert to or a string
variable containing the name of the type to convert to?

- Don
 
Is there anyway to convert an object from one type to another using either a
System.Type object containing the desired type to convert to or a string
variable containing the name of the type to convert to?

It depends on which types you're dealing with. The
System.ComponentModel.TypeConverter class may be useful.



Mattias
 
Mattias Sjögren said:
It depends on which types you're dealing with. The
System.ComponentModel.TypeConverter class may be useful.

I'm dealing with custom classes.
 

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