Data Structures and Database Applications Intro to Visual

Data Structures and Database Applications Intro to Visual Studio and Console Applications 1

Understanding the Visual IDE A Console Application 2

Understanding the Visual IDE Navigating the IDE Menu - File, Edit, View, Project, Build, Debug, Data, Tools, Windows, Help 3

Understanding the Visual IDE The Code Editor 4

Understanding the Visual IDE The Toolbars 5

Understanding the Visual IDE The Toolbox 6

Understanding the Visual IDE The Solution Explorer 7

Understanding the Visual IDE The Server Explorer 8

Understanding the Visual IDE The Properties Window 9

Understanding the Visual IDE The Error List Window 10

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 11

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 12

Windows Form Applications 13

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) 14

Web Applications 15

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 16

C# Elements 17

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 18

Create New Project 19

Code Automatically Generated 20

Typing Program Statements • Intelli. Sense 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 21

Rename Source Code Name Rename the class name here to Hello. World. cs Then click “Yes” and the class name in the code will be renamed to Hello. World 22

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( ); 23

Running an Application OR 24

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 25

Error Listing Missing ending double quotation mark 26
- Slides: 26