When to use CType, TryCast, DirectCast, CBool, etc.

Posted by: DevX: .NET Feed, on 29 Aug 2016 | View original | Bookmarked: 0 time(s)

Language: .NET||Expertise: BeginnerWhen you need to cast some type to another type in VB, you should favor the "classical" functions CBool, CByte, CInt, CLng, CDec, CSng, CDbl, CDate, CStr and the "new" kids on the block (CSByte, CShort, CUShort, CUInt, CULng, CChar, and CObj) as they were designed exactly for it....

Category: VB.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 288 | Hits: 10

Similar Posts

  • Unit Testing - Do Repeat Yourself more
  • Querying a Multi-Tenant Data Architecture more
  • Silverlight 3 “toast” notifications more
  • Update to Logging in to DotNetNuke from a Silverlight Application with RIA Authentication more
  • ASP.NET Membership Tip: Requiring New Users To Change Their Password When Logging On For The First Time more
  • A bad idea, EF Entities over WCF Part II more
  • SEO Tip - Beware of the Login pages - add them to Robots Exclusion more
  • Examining ASP.NET's Membership, Roles, and Profile - Part 15 more
  • Sending ELMAH Errors Via GMail more
  • Don't be afraid of complex constraints more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD