When working with data, such as setting or retrieving values from a form, you must normally take that information and either manipulate it or store it temporarily before you persist it to a database or a file.
In C# and Visual Basic .NET, you use variables to store information. Each variable that you declare is of a certain type, which is defined by the rules of the common type system (CTS). The CTS guarantees type safety between different languages, which was unheard of before .NET. That means when you use a String data type in C#, it's the same String data type that you use in Visual Basic .NET and COBOL .NET.
When I talk about different .NET languages, I mean that a language is considered a .NET language because it follows the rules of the Common Language Specification (CLS). The CTS exists in the CLS, which ensures type safety across all languages that have a .NET suffix. The allowable data types, their language-specific syntax, their CLS type, and their value ranges are listed in Table 8.1.
Note
If you're coming from a Visual Basic 6 background, notice the differences in the data type ranges. In Visual Basic .NET, the Short data type replaces the Integer data type, and the Integer data type replaces the Long data type. The Long data type in Visual Basic .NET is a 64-bit number; in Visual Basic 6, a Long data type was a 32-bit number.
3.145.55.198