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's typical about a windows process in regards to memory allocation in .net?
When we use windows api in .net is it managed or unmanaged code?
Can you explain what do you understand about web service?
What is il and c#?
What is RPC? What is the use of it?
Is there any inbuilt tool or command provided by .NET to view the code inside the assembly?
How many types of transactions are there in com + .net ?
Please explain what is immutability, what is it for and how is it codified?
Explain the difference between the stack and the heap?
Please explain what are an object and a class?
Is .net a programming language?
which method do you use to redirect the user to another page without performing a round trip to the client? How?
Explain what is the difference between response.redirect & server.transfer?
What is Event - Delegate? clear syntax for writing a event delegate
Explain different types of html, web and server controls.