dotnet webhosintg
  
asp.net hosting DotNet Hosting  eCommerce Hosting  SQL Server Hosting  ADO DotNet  ASP DotNet  DotNet Tutorials 
  
         
 

Your domain available ?
www.

BUY NOW
ASPNET 4
SQL SERVER HOSTING
SQL SERVER 2012 HOSTINGNew
DOTNETNUKE HOSTING
GET LISTED IN GOOGLE
30 DAY MONEY BACK
OUR PARTNERS
ASP NET TUTORIALS
WEB DESIGN TEMPLATES
TERMS
PRESS ROOM
CONTACT US




 

 

Using Option Strict- ASP DotNet

Tutorial - Using Option Strict in ASP DotNet

When used, the Option Strict statement must appear before any other code.

Visual Basic .NET generally allows implicit conversions of any data type to any other data type. Data loss can occur when the value of one data type is converted to a data type with less precision or smaller capacity, however, a run-time error message will occur if data will be lost in such a conversion. Option Strict ensures compile-time notification of these types of conversions so they may be avoided.

In addition to the conditions described above, Option Strict generates an error for:

- Any undeclared variable since it is implied that Option Strict also means Option Explicit.
Late-binding.


Option Strict On ' Force explicit variable declaration.
Dim MyVar As Integer ' Declare variables.
Dim Obj As Object
MyVar = 1000 ' Declared variable does not generate error.
MyVar = 1234567890.987654321 '
'Attempting to convert to an Integer will generate an error.
MyInt = 10 ' Undeclared variable generates error in Option Strict mode.
Call Obj.Method1() ' Late-bound call generates an error

 

 

 

Stacks of web space and bandwidth with all packages

ASP Hosting £6/Month


.net hosting

.NET Hosting £10/Month
400MB


Terms   Privacy

Copyright ©2002-2011 DotNet We Hosting UK, All rights reserved