As with all programming languages, you keep track of data in C# using variables. Variables can store numbers, text, dates, and times, and they can even point to full-fledged objects.
When you declare a variable, you give it a name, and you specify the type of data it will store. To declare a local variable, you start the line with the data type, followed by the name you want to use. A final semicolon ends the statement:
// Declare an integer variable named errorCode. int errorCode; // Declare a string variable named myName. string myName;
Remember, in C# the variables name and Name aren't equivalent! To confuse matters even more, C# programmers sometimes use this fact to their advantage—by using multiple variables ...