Thank you all for your comments.
Seems like the comments are a little diverse than i expected them to be
which might mean that the problem isnt that simple as it initially
seemed
to
me. I hope I aint asking for too much but can someone please summarize
(
if
possible ) the differences in terms of performance and IL generation
for
the
followings.
Intrinsic VB Conversion Ops ( CInt, CBool, CDbl, CLng, CObj, CStr
etc. )
Convert class Convert.To methods
CType method
DirectCast method
I understand that there are differences of ValueType and ReferenceType
and
the datatype diffreneces also count, but there must be some flow or
checklist to identify excatly when should one use which conversion
technique..
May b someone from Visual Basic Development team might be in the best
position to tell us which IL is better
( Dim i As Integer = CInt("1") )
IL_0001: ldstr "1"
IL_0006: call int32
[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType::F
romString(string)
IL_000b: stloc.0
( Dim j As Integer = CInt("2") )
IL_000c: ldstr "2"
IL_0011: call int32 [mscorlib]System.Convert::ToInt32(string)
IL_0016: stloc.1
Thank You Again All.
rawCoder