What is the Difference between directcast and ctype?

Answer Posted / aravindreddy

DirectCast requires the run-time type of an object variable
to bethe same
as the specified type.The run-time performance
ofDirectCast is better
than that of CType, if the specified type and the run-time
typeof the
expression are the same.
Ctype works fine if there is a valid conversion defined
between the
expression and the type.

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is il and c#?

573


What are the authentication methods in .net?

562


Can I write il programs directly?

560


How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?

531


What is the microsoft .net?

581






Why is .net used?

549


What are asp.net authentication providers and iis security?

524


object is physical and class is logical..here class is not occupying any memory as our definition of class but i got a question then the class where it stores if it is not occupying any memory....

1595


What are the purposes of using .net?

594


What is Flyout Design Pattern in .NET?

632


If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

1585


How to get the number after decimal point in .net?

562


What is concurrency? How will you avoid concurrency when dealing with dataset?

587


Explain asp.net?

605


Is .net core the future?

562