What is the Difference between directcast and ctype?
Answer Posted / narayan sahu(netx)
The difference between the two keywords is that CType
succeeds as long as there is a valid conversion defined
between the expression and the type, whereas DirectCast
requires the run-time type of an object variable to be the
same as the specified type. If the specified type and the
run-time type of the expression are the same, however, the
run-time performance of DirectCast is better than that of
CType. DirectCast throws an InvalidCastException error if
the argument types do not match.
| Is This Answer Correct ? | 12 Yes | 3 No |
Post New Answer View All Answers
What is meant by localization?
What versions of .net are there?
Describe the Managed Execution Process?
What are the types of assemblies in .net?
What is the use com component in .net?
Explain is the jit an interpreter?
What is il and c#?
Is the COM architecture same as .Net architecture? What is the difference between them (if at all there is)?
Explain what is the difference between web application and enterprise application?
What's singleton activation mode in .net?
What is the use of common language runtime?
What is a metadata in .net?
What operating systems does the .net framework run on?
Dynamic Fonts
What is the difference between a class and an object, and how do these terms relate to each other?