Data Structures and Database Applications Intro to Visual Studio and Console Applications
Understanding the Visual IDE A Console Application
Understanding the Visual IDE Navigating the IDE Menu - File, Edit, View, Project, Build, Debug, Data, Tools, Windows, Help
Understanding the Visual IDE The Code Editor
Understanding the Visual IDE The Toolbars
Understanding the Visual IDE The Toolbox
Understanding the Visual IDE The Solution Explorer
Understanding the Visual IDE The Server Explorer
Understanding the Visual IDE The Properties Window
Understanding the Visual IDE The Error List Window
Types of C# Applications Developed Console applications (Text based) Windows Form applications (GUI based - graphical user interface) Web applications Class libraries and stand-alone components (.dlls), smart device/mobile applications, and services can also be created
Console Applications Normally send requests to the operating system Display text on the command console Easiest to create Simplest approach to learning software development Minimal overhead for input and output of data
Windows Form Applications
Web Applications C# was designed with the Internet applications in mind Can quickly build applications that run on the Web with C# Using Web Forms: part of ASP.NET Using MVC: A more modern Web development Architecture (Pattern)
Web Applications
Windows Applications Applications designed for the desktop Designed for a single platform Use classes from System.Windows.Form namespace Applications can include menus, pictures, drop-down controls, buttons, textboxes, and labels Use drag-and-drop feature of Visual Studio
C# Elements
Create Console Application Begin by opening Visual Studio Create New Project Select New Project on the Start page OR use File → New Project option Select the Template Select “Visual C#” on the Left Select “Console Application” in the Center
Create New Project
Code Automatically Generated
Typing Program Statements IntelliSense feature of the IDE Change the name of the class and the source code filename Use the Solution Explorer Window to change the source code filename Select View → Solution Explorer
Rename Source Code Name Rename the class name here to HelloWorld.cs Then click “Yes” and the class name in the code will be renamed to HelloWorld
Compile and Run Application To run or execute application – click Start Debugging or Start Without Debugging on the Debug menu Shortcut – You can also just click on the Green Arrow with the word “Start” next to it: When the program finishes it does not hold the output screen → output flashes quickly Last statement in Main( ), add Console.Read( );
Running an Application OR
Debugging an Application Types of errors (which one is harder to detect?) Syntax errors Typing error Misspelled name Forget to end a statement with a semicolon Run-time errors Failing to fully understand the problem Logical error
Missing ending double quotation mark Error Listing Missing ending double quotation mark