Friday, June 19, 2009

difference between cast and convert in c#

anyway, between explicit conversions and Convert, the big difference seems to be that convert will actually look at the data. in an explicit conversion (cast) essentially the value of one datatype is copied into another datatype, without any concern for whether or not the copying actually makes sense. this is why you'll get runtime errors when you perform an explicit cast...