Groups | Blog | Home
all groups > asp.net > november 2003 >

asp.net : How to use - TypeConvertor class


Makarand
11/4/2003 11:01:45 PM
Hi

Can anybody tell me how to use TypeConvertor class?

Thing is i want to do dynamic(during runtime) type casting
in my code.

Thnanx

anonymous NO[at]SPAM discussions.microsoft.com
11/5/2003 4:39:17 AM
Hi

Thing is that I don't want to convert from one base type
to another base type.

I have object of type oject which i need to convert to
userdefined data types.

I hope this time I made my point more clear.

Regards
Makarand

[quoted text, click to view]
url=/library/en-
us/cpref/html/frlrfsystemconvertclasstopic.asp
[quoted text, click to view]
Janaka
11/5/2003 10:28:38 AM
I find the best one to use is the Convert class. Its got plenty of
overloads for Converting practically any type into another, and these are
all static. example:
string refNumber = "12312";
int curRef = Convert.ToInt32(refNumber);

see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemconvertclasstopic.asp

Janaka

[quoted text, click to view]

AddThis Social Bookmark Button