Re: most efficient way to convert data type

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Steven Cheng[MSFT] (v-schang_at_online.microsoft.com)
Date: 03/31/04


Date: Wed, 31 Mar 2004 02:05:29 GMT

Hi TS,

After some further searching, I've found the following definiation and
description on the two VB.NET specified CAST Expression(DirectCast and
CType)
#DirectCast
http://msdn.microsoft.com/library/en-us/vblr7/html/vakeyDirectCast.asp?frame
=true

#Cast Expressions
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfvbspec9_7.asp?frame=
true

It is mentioned that if both has the correct arguments and be called
successfully, the DirectCast has better performance than the CType.

In addtion, as for the Type.parse, I agree to Kevin's opinion that the
actual implement is under the hood and be
masked from us. My suggestion is that since the Type.parse is a runtime
function while the "DirectCast" is a language's directive, I'd perfer the
"DirectCast". Do you think so?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Quantcast