Liked us?

Everything to Improve Your knowledge February 2012 | <a href="/">Detailed expert reviews</a>

Monday, February 27, 2012

VB.Net Data types II


VB.Net Data Types II

Integer data type

}  The Integer data type widens to Long, Decimal, Single, or Double
}  The default value of Integer is 0.

' The valid range of an Integer variable is -2147483648
 through +2147483647.
Dim k As Integer
' The following statement causes an error because the value is too large.
k = 2147483648
' The following statement sets k to 6.
k = CInt(5.9)

Long Data Type

}  Use the Long data type to contain integer numbers that are too large to fit in the Integer data type.
}  The default value of Long is 0.

Short Data Type

}  Use the Short data type to contain integer values that do not require the full data width of Integer. In some cases, the common language runtime can pack your Short variables closely together and save memory consumption.
}  Holds signed 16-bit (2-byte) integers that range in value from -32,768 through 32,767.
}  The default value of Short is 0.
}  Eg:-
  Dim Value As Short = 32700

String data type

}  Use the String data type to hold multiple characters
}  The default value of String is Nothing (a null reference). Note that this is not the same as the empty string (value "").
}  Eg:-
  Dim j As String = "Joe said ""Hello"" to me." Dim h As String = "Hello"

Char data type

}  Use the Char data type when you need to hold only a single character and do not need the overhead of String. In some cases you can use Char(), an array of Char elements, to hold multiple characters.
}  The default value of Char is the character with a code point of 0.
}  Eg:-
Option Strict On Dim charVar As Char
 ‘ The following statement attempts to convert a
‘  String literal to Char.
‘  Because Option Strict is On, it generates a
‘ compiler error.
charVar = "Z"
' The following statement succeeds because it ‘specifies a Char literal.
charVar = "Z"C

Option Strict Statement

}  Restricts implicit data type conversions to only widening conversions.
  Option Strict { On | Off }
}  On Optional. Enables Option Strict checking.
}  Off Optional. Disables Option Strict checking. If On or Off is not specified, the default is Off.
}  Option Strict statement must appear in a file before any other source code statements
}  Visual Basic allows conversions of many data types to other data types.
}  Data loss can occur when the value of one data type is converted to a data type with less precision or smaller capacity.
}  A run-time error occurs if such a narrowing conversion fails.
}  Option Strict ensures compile-time notification of these narrowing conversions so that they can be avoided.

Boolean Data type

}  Holds values that can be only True or False.
}  The keywords True and False correspond to the two states of Boolean variables.
 Dim Status As Boolean = True

Related Posts : :

Sunday, February 26, 2012

VB.Net Data Types

VB.NET Data Types - i

What are Data types???

}  A data type is an attribute of a data which tells the computer (and the programmer) something about the kind of data it is.

Dim Statement (Visual Basic)

}  Declares and allocates storage space for one or more variables.
}  The Dim statement can declare the data type of a variable. You can specify any data type or the name of an enumeration, structure, class, or interface.
}   numberOfStudents As Integer
}    days() As Integer

Data Type Rules in VB.Net

}  Default Type
   If you do not specify datatype, the variable takes the data type of initializer. If neither datatype nor initializer is present, by default, the data type is Object Data Type. If you specify both datatype and initializer, the data type of initializer must be convertible to datatype.
    Dim finished As Boolean
    Dim monitorBox As System.Windows.Forms.Form
}  Different Types
   You can specify different data types for different variables by using a separate As clause for each variable you declare. Alternatively, you can declare several variables to be of the same type by using a common As clause. Each variable takes the data type specified in the first As clause encountered after its variablename part.
  a, b, c As Single, x, y As Double, i As Integer

Data Types in VB.Net

}  Integer
}  Long
}  Short
}  String
}  Char
}  Boolean
}  Etc.

Thursday, February 16, 2012

Write console application

Write console application
Referring this tutorial you can learn how to write console application using visual studio and these
Basic command:
How to open Console project
File -- > New -- > Project
Select Visual Basic
Select Console Application
See image :

Set Programme path and Name then click Ok.
Now you can write code here.

(i)                  Console.write()
Using this command you can retrieve one or more characters without insert new line.
Ex : Console.write(“www “)

(ii)    Console.writeline()
Using this command you can retrive one or more charactors with new line.
Ex : console.writeline (“www. etutez .com”)

(iii)               Console.Readline()
Using this command read character standard input stream.
Ex :
dim a as string
if you enter www .etutez .com then below image..

Monday, February 13, 2012

About .Net framework


}  What is .NET Framework?
       CLR, IL & multiplatform
       Multi-language support
       Common API

}  Enterprise Applications
       J2EE – specs and Application Servers
       .NET - Windows OS + .NET Servers
       Tools to develop (IDE)
       Visual Studio.NET
       Compare with Java (Netbeans, Eclipse,… etc.)

.NET Framework
What is .NET Framework?
}  “Everything” needed to build and deploy “.NET Applications”
}  “Everything” - Runtime environment, Classes, API’s, Tools, etc.
}  The .NET Framework is required to build and run any .NET application and is available today as a download via Windows Update or directly from the Microsoft .NET Web site

.NET Framework
}  A major and important component of .NET Framework is the runtime environment
}  What is a runtime environment?
       This is what an application sees!
       What is an application?
       Application is synonymous to Program  = set of instructions to do something
}  Runtime environment understands the instructions and executes them

}  The runtime environment in .NET Framework is called the Common Language Runtime (CLR)
}  A .NET Application is compiled into Intermediate Language (IL), also known as Microsoft Intermediate Language (MSIL) or managed code.
}  CLR compiles IL code and executes it.

Why not use OS’s runtime?
}  Operating System (OS) provides a runtime environment.
       Not standard across different OSs
}  Portability!!!
       Compile once, run anywhere

.NET Languages
}  Multiple languages (syntaxes) are supported in .NET Framework to build .NET Applications
}  E.g. C#, Visual Basic.NET etc.

}  In .NET, applications (multiple classes etc.) are compiled into a single assembly (usually taking the form of EXE or DLL).
}  Every assembly contains metadata that describes it, dependencies on other assemblies, and version information
}  Assemblies have the ability to make cross-references to other assemblies with information stored in metadata

}  In .NET Framework provides a comprehensive a standard class library, called .NET Framework Class Library, which assist to develop .NET applications in any .NET language.

Enterprise Applications
}  Enterprise Applications require a lot of features including:

Enterprise Applications: .NET Approach
}  No Application Server
}  Services/features distributed across various parts of the Operating System
}  .NET Framework APIs and services provide many features/services
}  In addition to OS, a range of products are available aimed for the enterprise:
}  Application Center
}  BizTalk Server
}  Commerce Server
}  Content Management Server
}  Exchange Server
}  Host Integration Server
}  SharePoint Portal Server
}  SQL Server

Deploying .NET Applications
Three alternatives exist for deploying a .NET Application:
}  Run as a Windows Service
   Windows Services are system-level processes that run on the machine independent of the user who is logged in. Typical services include functions of the operating system, schedulers, virus scanners, database engines, and network components. Using templates supplied with Visual Studio .NET, it is possible to take a .NET assembly and run it as a service.

}  Host through IIS 
  One way of hosting an assembly is to take advantage of IIS features. IIS allows an assembly to be deployed and will handle incoming connections, protocols, pooling, and security via a configuration file located with the assembly.

}  Use Component Services
  Component Services also known as COM+ Services, enable you to include functionalities such as recycling, state, transactions, method-level security, logging, impersonation, for hosted components through either an administration tool or the use of attributes.

}  IDEs play a key role for developer productivity in either platforms
}  In .NET, Visual Studio.NET is the predominately used IDE
}  In Java, a range of tools exists from different vendors: Eclipse, NetBeans, Sun ONE Studio, etc.



Detailed expert reviews Copyright © 2011 | Template design by O Pregador | Powered by Blogger Templates