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
How to instantiate a delegate?
What is the concept of inheritance in .net?
Explain how viewstate is being formed and how it's stored on client in .net?
Explain what is the difference between a class and an object, and how do these terms relate to each other?
Tell me about secure socket layer? How to make use of the technology?
i m fresher,hav SQL knowledge but in my ofc. i hav to work on dotnet. so plz tell me how to learn it,? from where to stat? i hav C prog. knowledge, ASP.net
How big is the datatype int in .net?
Please explain what are an inheritance, polymorphism, and encapsulation?
Explain webfarm vs webgardens in .net?
Why do we use the “using” statement?
Explain what do the terms “boxing” and “unboxing” mean?
Explain the different parts of an assembly?
Define satelite assembly?
Tell us what is json data, and what is one way that .net developers can work with json?
What is the difference between asp.net and asp?