Evaluation Copy. C# Essentials. Student Guide Revision 4.5. Object Innovations Course 4102

Size: px
Start display at page:

Download "Evaluation Copy. C# Essentials. Student Guide Revision 4.5. Object Innovations Course 4102"

Transcription

1 C# Essentials Student Guide Revision 4.5 Object Innovations Course 4102

2 C# Essentials Rev. 4.5 Student Guide Information in this document is subject to change without notice. Companies, names and data used in examples herein are fictitious unless otherwise noted. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Object Innovations. Product and company names mentioned herein are the trademarks or registered trademarks of their respective owners. Author: Robert J. Oberg Special Thanks: Johnathon McAlister Copyright 2012 Object Innovations Enterprises, LLC All rights reserved. Object Innovations Printed in the United States of America. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC ii

3 Table of Contents (Overview) Chapter 1.NET: What You Need to Know Chapter 2 C# Overview for the Sophisticated Programmer Chapter 3 Object-Oriented Programming in C# Chapter 4 Chapter 5 Chapter 6 C# and the.net Framework Delegates and Events Introduction to Windows Forms Chapter 7 New Features in C# 4.0 and C# 5.0 Appendix A Using Visual Studio 2012 Appendix B Language Integrated Query (LINQ) Appendix C Visual Studio 2010 and Visual Studio 2012 Appendix D Learning Resources Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC iii

4 Directory Structure The course software installs to the root directory C:\OIC\CsEss. Example programs for each chapter are in named subdirectories of chapter directories Chap01, Chap02, and so on. Example programs for Appendices A, B and C are in the directories AppA, AppB and AppC. The Labs directory contains one subdirectory for each lab, named after the lab number. Starter code is frequently supplied, and answers are provided in the chapter directories. The CaseStudy directory contains a case study in multiple steps. The Demos directory is provided for performing in-class demonstrations led by the instructor. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC iv

5 Table of Contents (Detailed) Chapter 1.NET: What You Need to Know... 1 Getting Started... 3.NET: What Is Really Happening... 4.NET Programming in a Nutshell... 5.NET Program Example... 6 Viewing the Assembly... 7 Viewing Intermediate Language... 8 Understanding.NET... 9 Visual Studio Creating a Console Application Adding a C# File Using the Visual Studio Text Editor IntelliSense Build and Run the Project Pausing the Output Visual C# and GUI Programs NET Documentation Summary Chapter 2 C# Overview for the Sophisticated Programmer Hello, World Compiling, Running (Command Line) Program Structure Namespaces Variables Input in C# More about Classes InputWrapper Class Sample Program Input Wrapper Implementation Compiling Multiple Files Control Structures switch C# Operators Precedence Table Types in C# Simple Types Types in System Namespace Integer Data Types Floating Point Data Types Implicit Conversions Explicit Conversions Boolean Data Type Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC v

6 struct Uninitialized Variables Enumeration Types Nullable Types Reference Types Class Types object string Copying Strings StringBuilder Class Classes and Structs Static and Instance Methods Method Parameters No Freestanding Functions in C# Classes with All Static Methods Parameter Passing Parameter Terminology Value Parameters Reference Parameters Reference Parameters Example Output Parameters Output Parameters Example Structure Parameters Class Parameters Method Overloading Variable Length Parameter Lists Arrays One-Dimensional Arrays System.Array Jagged Arrays Rectangular Arrays foreach for Arrays Boxing and Unboxing Implicitly Typed Variables Implicitly Typed Variables Example Output in C# Formatting Formatting Example Exceptions Exception Example Checked Integer Arithmetic Throwing New Exceptions finally System.Exception Lab Summary Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC vi

7 Chapter 3 Object-Oriented Programming in C# C# Object-Oriented Features Encapsulation and Accessors Asymmetric Accessor Accessibility Using a Property Indexers Visual Studio Console Projects Files in Skeleton Solution Source Files Bank Example Account Class Constructors Static Members Static in Main Static Constructor Constant and Readonly Fields Auto-Implemented Properties Auto-Implemented Property Example Inheritance in C# New Version of Base Class Features of the New Base Class Derived Class Overriding a Virtual Function Abstract Classes Keyword: abstract Derived Class Test Program Sealed Classes Access Control and Assemblies Internal Accessibility Assembly Example Class Libraries Lab Summary Chapter 4 C# and the.net Framework Components and OO in C# Interfaces in C# Interface Inheritance Programming with Interfaces Implementing Interfaces Using an Interface Example: SmallInterface Dynamic Use of Interfaces Example: TryInterfaces is Operator as Operator Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC vii

8 Resolving Ambiguity Explicit Interface Implementation Explicit Interfaces Test Program System.Object Collections ArrayList ArrayList Methods Example: StringList IEnumerable and IEnumerator Using Enumerators Collections of User-Defined Objects Account Class AccountList Class Copy Semantics in C# Deep Copy and ICloneable Lab 4A Writing Generic Code Using a Class of object Generic Types Generic Syntax in C# Generic Example Generic Client Code System.Collections.Generic Lab 4B Object Initializers Collection Initializers Anonymous Types Attributes Attribute Usage Example Summary Chapter 5 Delegates and Events Overview of Delegates and Events Callbacks and Delegates Usage of Delegates Declaring a Delegate Defining a Method Creating a Delegate Object Calling a Delegate Random Number Generation A Random Array Anonymous Methods Combining Delegate Objects Account.cs DelegateAccount.cs Lambda Expressions Named Method Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC viii

9 Anonymous Method Lambda Expression Example Events Events in C# and.net Client Side Event Code Chat Room Example Lab Summary Chapter 6 Introduction to Windows Forms Creating a Windows Forms App Partial Classes Windows Forms Event Handling Add Events for a Control Events Documentation Closing a Form ListBox Control ListBox Example Lab Summary Chapter 7 New Features in C# 4.0 and C# dynamic Type Runtime Error Example dynamic versus object Behavior of object Behavior of dynamic Named Arguments Optional Arguments Book Class Using Optional Arguments Variance in Generic Interfaces Covariance Example Variance with IComparer<T> Interfaces with Variance Support Contravariance Example Asynchronous Programs in C# Task and Task<TResult> Aysnc Methods Async Example Synchronous Call Async Call Threading Summary Appendix A Using Visual Studio A Visual Studio Solution Toolbars Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC ix

10 Customizing a Toolbar Creating a Console Application Adding a C# File Using the Visual Studio Text Editor Build and Run the Bytes Project Running the Bytes Project Executable File Location Managing Configurations Project Configurations Creating a New Configuration Setting Configuration Build Settings Debugging Breakpoints Watch Variables Debug Toolbar Stepping with the Debugger Demo: Stepping with the Debugger Call Stack and Call Hierarchy Multiple-Project Solution Demo Adding a Reference Project Dependencies Startup Project Hidden Files Summary Appendix B Language Integrated Query (LINQ) Language-Integrated Query (LINQ) LINQ Example Using IEnumerable<T> Basic LINQ Query Operators Obtaining a Data Source LINQ Query Example Filtering Ordering Aggregation Obtaining Lists and Arrays Deferred Execution Summary Appendix C Visual Studio 2010 and Visual Studio VS 2010 Solutions with VS NET Framework Versions NET Version Issues Summary Appendix D Learning Resources Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC x

11 CsEss Chapter 1 Chapter 1.NET: What You Need to Know Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 1

12 CsEss Chapter 1.NET: What You Need to Know Objectives After completing this unit you will be able to: Describe the essentials of creating and running a program in the.net environment. Build and run a simple C# program. Use the ILDASM tool to view intermediate language. Use Visual Studio 2012 as an effective environment for creating C# programs. Use the.net Framework SDK documentation. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 2

13 CsEss Chapter 1 Getting Started From a programmer s perspective, a beautiful thing about.net is that you scarcely need to know anything about it to start writing programs for the.net environment. You write a program in a high-level language (such as C#), a compiler creates an executable.exe file (called an assembly), and you run that.exe file. Even very simple programs, if they are designed to do something interesting, such as perform output, will require that the program employ the services of library code. A large library, called the.net Framework Class Library, comes with.net, and you can use all of the services of this library in your programs. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 3

14 CsEss Chapter 1.NET: What Is Really Happening The assembly that is created does not contain executable code, but, rather, code in Intermediate Language, or IL (sometimes called Microsoft Intermediate Language, or MSIL). In the Windows environment, this IL code is packaged up in a standard portable executable (PE) file format, so you will see the familiar.exe extension (or, if you are building a component, the.dll extension). You can view an assembly using the ILDASM tool. When you run the.exe, a special runtime environment (the Common Language Runtime, or CLR) is launched and the IL instructions are executed by the CLR. Unlike some runtimes, where the IL would be interpreted each time it is executed, the CLR comes with a just-in-time (JIT) compiler, which translates the IL to native machine code the first time it is encountered. On subsequent calls, the code segment runs as native code. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 4

15 CsEss Chapter 1.NET Programming in a Nutshell 1. Write your program in a high-level.net language, such as C#. 2. Compile your program into IL. 3. Run your IL program, which will launch the CLR to execute your IL, using its JIT to translate your program to native code as it executes. We will look at a simple example of a C# program, and run it under.net. Don t worry about the syntax of C#, which we will start discussing in the next chapter. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 5

16 CsEss Chapter 1.NET Program Example See SimpleCalc in the Chap01 folder. 1. Enter the program in a text editor. // SimpleCalc.cs // // This program does a simple calculation: // calculate area of a rectangle public class SimpleCalc { static void Main() { int width = 20; int height = 5; int area; area = width * height; System.Console.WriteLine("area = {0}", area); } } 2. Compile the program at the command-line. Start the console window via Start All Programs Microsoft Visual Studio 2012 Visual Studio Tools Developer Command Prompt for VS2012. Navigate to folder \OIC\CsEss\Chap01\SimpleCalc. >csc SimpleCalc.cs 3. Run your IL program SimpleCalc.exe >SimpleCalc area = 100 Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 6

17 CsEss Chapter 1 Viewing the Assembly You can view the assembly using the ILDASM tool 1. >ildasm SimpleCalc.exe 1 You can change the font size from the View menu. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 7

18 CsEss Chapter 1 Viewing Intermediate Language Double-click on Main:void() Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 8

19 CsEss Chapter 1 Understanding.NET The nice thing about a high-level programming language is that you usually do not need to be concerned with the platform on which the program executes. You can work with the abstractions provided by the language and with functions provided by libraries. Your appreciation of the C# programming language and its potential for creating great applications will be richer if you have a general understanding of.net. After this course, we suggest you next study: Test-Driven Development (Unit Testing).NET Framework Using C# And then, depending on your interests: Data Access Windows Web ADO.NET Windows Forms ASP.NET XML Programming WPF ASP.NET MVC ASP.NET AJAX Silverlight WCF Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 9

20 CsEss Chapter 1 Visual Studio 2012 While it is possible to write C# programs using any text editor, and compile them with the command-line compiler, it is very tedious to program that way. An IDE makes the process of writing software much easier. An IDE provides convenience items, such as a syntaxhighlighting editor. An IDE reduces the tedium of keeping track of configurations, environment settings and file organizations. You may use Visual Studio 2012 throughout this course to create and compile your C# programs. Visual Studio 2012 is discussed in more detail in Appendix A. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 10

21 CsEss Chapter 1 Creating a Console Application We will now create a simple console application. Our program is the same simple calculator we created earlier that was compiled at the command line. 1. From the Visual Studio main menu, choose File New Project... This will bring up the New Project dialog. 2. Choose Visual C# and Console Application. 3. Leave.NET Framework 4.5 as the target framework. Leave checked Create directory for solution In the Name field, type SimpleCalcVs and for Location browse to C:\OIC\CsEss\Demos. Click OK. 2 Examples in later chapters frequently do not have a directory for solution. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 11

22 CsEss Chapter 1 Adding a C# File There will be a number of starter files. Expand properties and select the files AssemblyInfo.cs, App.config and Program.cs. Press the Delete key. We are now going to add a file SimpleCalc.cs, which contains the text of our program. 1. In Solution Explorer, right click over SimpleCalcVs and choose Add New Item... This will bring up the Add New Item dialog. 2. In the middle pane, choose Code File. For Name type SimpleCalc.cs. Click Add. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 12

23 CsEss Chapter 1 Using the Visual Studio Text Editor The empty file SimpleCalc.cs will now be open in the Visual Studio text editor. Enter the following program. Or you could just copy from Chap01\SimpleCalc\. // SimpleCalc.cs // // This program does a simple calculation: // calculate area of a rectangle public class SimpleCalc { static void Main() { int width = 20; int height = 5; int area; area = width * height; System.Console.WriteLine("area = {0}", area); } } Notice that the Visual Studio text editor highlights syntax, indents automatically, and so on. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 13

24 CsEss Chapter 1 IntelliSense A powerful feature of Visual Studio is IntelliSense. IntelliSense will automatically pop up a list box allowing you to easily insert language elements directly into your code. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 14

25 CsEss Chapter 1 Build and Run the Project Building a project means compiling the individual source files and linking them together with any library files to create an IL executable.exe file. You can build the project by using one of the following: Menu Build Build Solution or toolbar button keyboard shortcut Ctrl+Shift+B. or Menu Build Build SimpleCalcVs or toolbar button just builds the project SimpleCalcVs) 3. (this You can run the program without the debugger by using one of the following: Menu Debug Start Without Debugging Toolbar button (This button is not provided by default; see Appendix A for how to add it to your Build toolbar.) Keyboard shortcut Ctrl + F5 You can run the program in the debugger by using one of the following: Menu Debug Start Debugging Toolbar button Keyboard shortcut F5. 3 The two are the same in this case, because the solution has only one project, but some solutions have multiple projects, and then there is a difference. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 15

26 CsEss Chapter 1 Pausing the Output If you run the program in the debugger from Visual Studio, you will notice that the output window automatically closes on program termination. To keep the window open, you may prompt the user for some input. public class SimpleCalc { static void Main() { int width = 20; int height = 5; int area; area = width * height; System.Console.WriteLine("area = {0}", area); System.Console.WriteLine( "Prese Enter to exit"); System.Console.ReadLine(); } } This program is saved as a Visual Studio solution in Chap01\SimpleCalcVs 4. Remember that you can always make the console window stay open by running without the debugger via Ctrl + F5. 4 The solution can be opened in either Visual Studio 2010 or Visual Studio The project uses.net 4.0 and so will run on either.net 4.0 or.net 4.5. The same is true with Chap01\SimpleCalcGui. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 16

27 CsEss Chapter 1 Visual C# and GUI Programs Microsoft s implementation of the C# language, Visual C#, works very effectively in a GUI environment. Using Windows Forms, it is easy to create Windows GUI programs in C#. Example: See Chap01\SimpleCalcGui We will discuss GUI programming using C# in Chapter 6. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 17

28 CsEss Chapter 1.NET Documentation.NET Framework documentation is included with Visual Studio Use the menu Help View Help. Other menu choices let you add and remove content and to set a preference for launching in Browser or Help Viewer. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 18

29 CsEss Chapter 1 Summary As in other environments, with.net you write a program in a high-level language, compile to an executable (.EXE file), and run that.exe file. The.EXE file, called an assembly, contains Intermediate Language instructions. You can view an assembly through the ILDASM tool. Visual Studio 2012 is a powerful IDE that makes it easy to develop C# programs. With Visual Studio it is easy to create GUI programs using C#. You can access extensive.net Framework documentation through the Visual Studio help system. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 19

30 CsEss Chapter 1 Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 20

31 CsEss Chapter 6 Chapter 6 Introduction to Windows Forms Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 219

32 CsEss Chapter 6 Introduction to Windows Forms Objectives After completing this unit you will be able to: Use Visual Studio 2012 to implement a simple graphical user interface with Windows Forms and basic controls. Use partial classes to organize class code over multiple files. Explain the principles of event handling in Windows Forms and implement handlers for simple control events. Use a ListBox control to display a list of objects. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 220

33 CsEss Chapter 6 Creating a Windows Forms App It is easy to create a Windows Forms application using the Form Designer in Visual Studio This same Form Designer is also available for Visual Basic and Visual C Create a new C# project BankGui of type Windows Forms Application. The Location should be the Demos directory. Leave checked Create directory for solution. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 221

34 CsEss Chapter 6 Windows Forms Demo (Cont d) 2. From the toolbox, drag two labels, two textboxes, and two buttons to the form. Use the resizing handles to resize the form. 3. Enter property values for the form, textboxes and buttons: Name Form1 txtamount txtbalance cmddeposit cmdwithdraw Text Bank Account (blank) (blank) Deposit Withdraw 4. Add event handlers for the buttons by double-clicking on each button. 5. Add an event handler for the Form s Load event by doubleclicking over any empty area of the form. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 222

35 CsEss Chapter 6 Windows Forms Demo (Cont d) 6. Add the following code: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void cmddeposit_click(object sender, EventArgs e) { int amount = Convert.ToInt32(txtAmount.Text); int balance = Convert.ToInt32(txtBalance.Text); balance += amount; txtbalance.text = Convert.ToString(balance); } private void cmdwithdraw_click(object sender, EventArgs e) { int amount = Convert.ToInt32(txtAmount.Text); int balance = Convert.ToInt32(txtBalance.Text); balance -= amount; txtbalance.text = Convert.ToString(balance); } } private void Form1_Load(object sender, EventArgs e) { txtamount.text = "25"; txtbalance.text = "100"; } Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 223

36 CsEss Chapter 6 Windows Forms Demo (Cont d) 7. Build and run the application. It should behave like a standard Windows application. The completed demo is in the BankGui\Step1 directory for this chapter. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 224

37 CsEss Chapter 6 Partial Classes In.NET 2.0 and higher, you can split the definition of a class over two or more source files. Use the partial keyword modifier. Code maintenance can be simplified for large classes. The Windows Form Designer generates partial classes. The boiler plate code generated by the Form Designer is kept in one file, which is not touched by the programmers. Code added by the programmer is maintained in another file. // Form1.Designer.cs namespace BankGui { partial class Form1 { /// <summary> /// Required designer variable. /// </summary>... // Form1.cs... namespace BankGui { public partial class Form1 : Form { public Form1() { InitializeComponent(); }... Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 225

38 CsEss Chapter 6 Windows Forms Event Handling GUI applications are event-driven, in which the application executes code in response to user events, such as clicking the mouse, choosing a menu item, etc. Each form or control has a predefined set of events. For example, every button has a Click event. Windows Forms uses the.net event model, which uses delegates to bind events to the methods that handle them. Windows Forms typically uses multi-cast delegates. A multi-cast delegate maintains a list of the methods it is bound to. When an event occurs in an application, the control raises the event by calling the delegate for that event. The delegate then calls all of the methods it is bound to. C# provides the overloaded += operator for adding a delegate to an event. this.cmddeposit.click += new System.EventHandler(this.cmdDeposit_Click); This code is in the wizard-generated file Form1.Designer.cs. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 226

39 CsEss Chapter 6 Add Events for a Control Every control has a primary event. You can add a handler for this event by double-clicking on the control in the Visual Studio Form Designer. We added a handler for the Deposit and Withdraw buttons in this way. You can add other events by selecting the in the Properties window and double-clicking on a selected event. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 227

40 CsEss Chapter 6 Events Documentation You can find all of the events associated with a class in the.net Framework Reference. This screen shot shows documentation for the FormClosing event of the Form class. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 228

41 CsEss Chapter 6 Closing a Form A form may be closed in a number of ways, such as by clicking the at the top-right, using the system menu at the top-left, pressing Alt+F4, and so on. In all cases, the FormClosing event will be fired, providing an opportunity to cancel the closing. Continuing our simple Bank Account form demo, add the following code to the handler of the FormClosing event. See BankGui\Step2. private void Form1_FormClosing(object sender, FormClosingEventArgs e) { DialogResult result = MessageBox.Show( "Do you really want to close?", "Bank Account", MessageBoxButtons.YesNo); if (result!= DialogResult.Yes) e.cancel = true; } The following dialog will be displayed: Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 229

42 CsEss Chapter 6 ListBox Control The.NET Framework provides a number of controls that you can use to display lists of items to the user. These controls also allow the user to select an item from the list, typically by clicking on the item to be selected. The simplest list control is the ListBox control. The collection Items maintains a collection of object references. There are methods such as Add(), Remove() and Clear(). The property SelectedItem gets or sets the currently selected item in the listbox. Perform a cast to get out an item of a particular type. The property SelectedIndex gets or sets the zero-based index of the currently selected item ( 1 if no item is selected). The event SelectedIndexChanged is fired when the user selects a new index. There are many more properties, methods, and events, which you can study from the documentation. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 230

43 CsEss Chapter 6 ListBox Example The program ListBoxDemo illustrates maintaining a list of strings in a listbox. private void cmdadd_click(object sender, EventArgs e) { listbox1.items.add(txtstring.text); } private void cmdremove_click(object sender, EventArgs e) { listbox1.items.remove(txtstring.text); } private void listbox1_selectedindexchanged( object sender, EventArgs e) { if (listbox1.selectedindex!= -1) txtstring.text = (string)listbox1.selecteditem; } Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 231

44 CsEss Chapter 6 Lab 6 A GUI for Acme In this lab, you will implement a GUI interface for the Acme customer management system implemented in Chapter 4. Detailed instructions are contained in the Lab 6 write-up at the end of the chapter. Suggested time: 60 minutes Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 232

45 CsEss Chapter 6 Summary With Visual Studio 2012, you can implement a simple graphical user interface with Windows Forms and basic controls. You can use partial classes to organize class code over multiple files. Windows Forms uses the.net event architecture to handle user interface events..net provides various list controls, such as ListBox, for displaying lists of objects. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 233

46 CsEss Chapter 6 Introduction Lab 6 A GUI for Acme In this lab, you will implement a GUI interface for the Acme customer management system implemented in Chapter 4. Suggested Time: 60 minutes Root Directory: OIC\CsEss Directories: Labs\Lab6 CaseStudy\Acme\Step2C CaseStudy\Acme\Step3 (do your work here) (previous version) (answer) Files: AcmeCms.cs Part A. Create the GUI and List Customers 1. Create a new Visual C# project of type Windows Forms Application AcmeGui located in Labs\Lab6. 2. Change the file name Form1.cs to AcmeCms.cs. Say yes to rename all references to the code element Form1. Thus the form class will now also be AcmeCms. 3. Change the Text property of the form to Acme Customer Management System. 4. Add controls to the form as shown: Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 234

47 CsEss Chapter 6 5. Make the names of the controls shown: txtid, txt address, txtfirstname, txtlastname, listcustomers, cmdregister, cmdunregister, cmdchange . 6. Copy the files Customer.cs and Test.cs from CaseStudy\Acme\Step2C to the working directory. Add the file Customer.cs to the project. (Test.cs will be a miscellaneous file that you can refer to as you migrate command-line client code to GUI client code.) 7. Add a private data member custs of type Customers to class AcmeCms. 8. Create a handler for the Load event in the AcmeCms class. Add code to instantiate a custs object. 9. From the file Test.cs, copy code to display the customer list by calling a helper method ShowCustomerArray, passing it the results of calling the GetCustomer method. 10. Implement a private method ShowCustomerArray to display the customers in the array list in the list box of the main form. Base your code on the code in Test.cs. Don t worry about padding to make neat columns, because it won t work anyway in a listbox with a variable pitch font. (To make neat columns you should use a more advanced control, such as ListView or DataGridView.) Just use a single space as a separator of fields when you build up a string to add to the listbox. To add a string to a listbox, you can use the following code: listcustomers.items.add(str); If the array list is null, throw an exception. 11. Build and test the program. You should see a starting list of customers displayed. Part B. Register a New Customer In this part, you will add code for registering a new customer. 1. Add an event handler for clicking the Register button. 2. Add code in this handler to call the RegisterCustomer method of the Customers class. You will pass in the first name, last name, and address from the textboxes. You will get back an ID, which you will display. 3. Add code to redisplay all of the customers in the listbox. Build and test. 4. You will see the new customer that was added, but you will also see a duplicate of the original customers. Fix this problem by clearing the listbox in the helper method before doing the display. Build and test. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 235

48 CsEss Chapter 6 Part C. Select a Customer and Split into Fields In this part, you will add code to select a customer by clicking in the listbox. Relying on the specification that there are no embedded spaces in any of the fields of a customer, you will extract the individual fields using a space as a separator. This extracted information will be shown in the textboxes. 1. Add a handler for the event SelectedIndexChanged of the listbox. (Recall that you use the button to obtain a list of events associated with a control.) 2. Test to see if an item has been selected by checking if listcustomers.selectedindex is different from If an item has been selected, obtain the selected string and split it into fields (relying on a space as a separator) by the following code: string selected = (string) listcustomers.selecteditem; char[] sep = new char[] {' '}; string[] fields; fields = selected.split(sep); 5. Add code to set the textboxes to the corresponding fields of the selected customer. 6. Build and test. As you select different customers, you should see the information in the textboxes change appropriately. Part D. Unregister a Customer and Change Address In this final part, you will add code for unregistering a new customer. You will also add code for changing an address. 1. Add a handler for the Unregister button. 2. Add code to unregister the currently selected customer (if there is one), as shown by the ID. When done, clear the textboxes and refresh the listbox. You may build and test at this point. 3. Add a handler for the Change button. Add code to change the address of the currently selected customer (if there is one). 4. Build and test. Your miniature customer management system should now be fully operational! You are now at Step 3. Rev. 4.5 Copyright 2012 Object Innovations Enterprises, LLC 236

C++/CLI Essentials. Student Guide Revision 1.0. Object Innovations Course 431

C++/CLI Essentials. Student Guide Revision 1.0. Object Innovations Course 431 C++/CLI Essentials Student Guide Revision 1.0 Object Innovations Course 431 C++/CLI Essentials Rev. 1.0 Student Guide Information in this document is subject to change without notice. Companies, names

More information

Object-Oriented Programming in C# (VS 2015)

Object-Oriented Programming in C# (VS 2015) Object-Oriented Programming in C# (VS 2015) This thorough and comprehensive 5-day course is a practical introduction to programming in C#, utilizing the services provided by.net. This course emphasizes

More information

Object-Oriented Programming in C# (VS 2012)

Object-Oriented Programming in C# (VS 2012) Object-Oriented Programming in C# (VS 2012) This thorough and comprehensive course is a practical introduction to programming in C#, utilizing the services provided by.net. This course emphasizes the C#

More information

Evaluation Copy. Visual Basic Essentials. Student Guide Revision 4.5. Object Innovations Course 4202

Evaluation Copy. Visual Basic Essentials. Student Guide Revision 4.5. Object Innovations Course 4202 Visual Basic Essentials Student Guide Revision 4.5 Object Innovations Course 4202 Visual Basic Essentials Rev. 4.5 Student Guide Information in this document is subject to change without notice. Companies,

More information

EVALUATION COPY. Unauthorized reproduction or distribution is prohibitied C# ESSENTIALS

EVALUATION COPY. Unauthorized reproduction or distribution is prohibitied C# ESSENTIALS C# ESSENTIALS C# Essentials Rev. 4.8 Student Guide Information in this document is subject to change without notice. Companies, names and data used in examples herein are fictitious unless otherwise noted.

More information

Object-Oriented Programming in C# Evaluation Copy. Student Guide Revision 4.5. Object Innovations Course 4101

Object-Oriented Programming in C# Evaluation Copy. Student Guide Revision 4.5. Object Innovations Course 4101 Object-Oriented Programming in C# Student Guide Revision 4.5 Object Innovations Course 4101 Object-Oriented Programming in C# Rev. 4.5 Student Guide Information in this document is subject to change without

More information

EVALUATION COPY. Object-Oriented Programming in C# Student Guide Revision 4.6. Unauthorized reproduction or distribution is prohibited.

EVALUATION COPY. Object-Oriented Programming in C# Student Guide Revision 4.6. Unauthorized reproduction or distribution is prohibited. Object-Oriented Programming in C# Student Guide Revision 4.6 Object Innovations Course 4101 Object-Oriented Programming in C# Rev. 4.6 Student Guide Information in this document is subject to change without

More information

Course Syllabus C # Course Title. Who should attend? Course Description

Course Syllabus C # Course Title. Who should attend? Course Description Course Title C # Course Description C # is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the.net Framework.

More information

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio Introduction XXV Part I: C# Fundamentals 1 Chapter 1: The.NET Framework 3 What s the.net Framework? 3 Common Language Runtime 3.NET Framework Class Library 4 Assemblies and the Microsoft Intermediate Language

More information

Student Guide Revision 1.0

Student Guide Revision 1.0 Robert J. Oberg Student Guide Revision 1.0 Object Innovations Course 411 C# Essentials Rev. 1.0 Student Guide Information in this document is subject to change without notice. Companies, names and data

More information

Prerequisites: The student should have programming experience in a high-level language. ITCourseware, LLC Page 1. Object-Oriented Programming in C#

Prerequisites: The student should have programming experience in a high-level language. ITCourseware, LLC Page 1. Object-Oriented Programming in C# Microsoft s.net is a revolutionary advance in programming technology that greatly simplifies application development and is a good match for the emerging paradigm of Web-based services, as opposed to proprietary

More information

C# Programming in the.net Framework

C# Programming in the.net Framework 50150B - Version: 2.1 04 May 2018 C# Programming in the.net Framework C# Programming in the.net Framework 50150B - Version: 2.1 6 days Course Description: This six-day instructor-led course provides students

More information

Microsoft. Microsoft Visual C# Step by Step. John Sharp

Microsoft. Microsoft Visual C# Step by Step. John Sharp Microsoft Microsoft Visual C#- 2010 Step by Step John Sharp Table of Contents Acknowledgments Introduction xvii xix Part I Introducing Microsoft Visual C# and Microsoft Visual Studio 2010 1 Welcome to

More information

C# Programming: From Problem Analysis to Program Design. Fourth Edition

C# Programming: From Problem Analysis to Program Design. Fourth Edition C# Programming: From Problem Analysis to Program Design Fourth Edition Preface xxi INTRODUCTION TO COMPUTING AND PROGRAMMING 1 History of Computers 2 System and Application Software 4 System Software 4

More information

Object-Oriented Programming in Visual Basic

Object-Oriented Programming in Visual Basic Object-Oriented Programming in Visual Basic Dana L. Wyatt Robert J. Oberg Student Guide Revision 2.1 Object Innovations Course 420 Object-Oriented Programming in Visual Basic Rev. 2.1 Student Guide Information

More information

Microsoft Visual C# Step by Step. John Sharp

Microsoft Visual C# Step by Step. John Sharp Microsoft Visual C# 2013 Step by Step John Sharp Introduction xix PART I INTRODUCING MICROSOFT VISUAL C# AND MICROSOFT VISUAL STUDIO 2013 Chapter 1 Welcome to C# 3 Beginning programming with the Visual

More information

CHAPTER 1: INTRODUCING C# 3

CHAPTER 1: INTRODUCING C# 3 INTRODUCTION xix PART I: THE OOP LANGUAGE CHAPTER 1: INTRODUCING C# 3 What Is the.net Framework? 4 What s in the.net Framework? 4 Writing Applications Using the.net Framework 5 What Is C#? 8 Applications

More information

Course Hours

Course Hours Programming the.net Framework 4.0/4.5 with C# 5.0 Course 70240 40 Hours Microsoft's.NET Framework presents developers with unprecedented opportunities. From 'geoscalable' web applications to desktop and

More information

Introduce C# as Object Oriented programming language. Explain, tokens,

Introduce C# as Object Oriented programming language. Explain, tokens, Module 2 98 Assignment 1 Introduce C# as Object Oriented programming language. Explain, tokens, lexicals and control flow constructs. 99 The C# Family Tree C Platform Independence C++ Object Orientation

More information

Learning C# 3.0. Jesse Liberty and Brian MacDonald O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo

Learning C# 3.0. Jesse Liberty and Brian MacDonald O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo Learning C# 3.0 Jesse Liberty and Brian MacDonald O'REILLY Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo Table of Contents Preface xv 1. C# and.net Programming 1 Installing C# Express 2 C# 3.0

More information

DOT NET SYLLABUS FOR 6 MONTHS

DOT NET SYLLABUS FOR 6 MONTHS DOT NET SYLLABUS FOR 6 MONTHS INTRODUCTION TO.NET Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate

More information

The C# Programming Language. Overview

The C# Programming Language. Overview The C# Programming Language Overview Microsoft's.NET Framework presents developers with unprecedented opportunities. From web applications to desktop and mobile platform applications - all can be built

More information

Programming in Visual Basic with Microsoft Visual Studio 2010

Programming in Visual Basic with Microsoft Visual Studio 2010 Programming in Visual Basic with Microsoft Visual Studio 2010 Course 10550; 5 Days, Instructor-led Course Description This course teaches you Visual Basic language syntax, program structure, and implementation

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led CENTER OF KNOWLEDGE, PATH TO SUCCESS Website: PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO 2010 Course: 10550A; Duration: 5 Days; Instructor-led WHAT YOU WILL LEARN This course teaches you

More information

DOT NET Syllabus (6 Months)

DOT NET Syllabus (6 Months) DOT NET Syllabus (6 Months) THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate Language (IL) Just- In- Time Compilation and CLS Disassembling.Net Application to IL

More information

10266 Programming in C Sharp with Microsoft Visual Studio 2010

10266 Programming in C Sharp with Microsoft Visual Studio 2010 10266 Programming in C Sharp with Microsoft Visual Studio 2010 Course Number: 10266A Category: Visual Studio 2010 Duration: 5 days Course Description The course focuses on C# program structure, language

More information

C# Syllabus. MS.NET Framework Introduction

C# Syllabus. MS.NET Framework Introduction C# Syllabus MS.NET Framework Introduction The.NET Framework - an Overview Framework Components Framework Versions Types of Applications which can be developed using MS.NET MS.NET Base Class Library MS.NET

More information

Programming in C# with Microsoft Visual Studio 2010

Programming in C# with Microsoft Visual Studio 2010 Programming in C# with Microsoft Visual Studio 2010 Course 10266; 5 Days, Instructor-led Course Description: The course focuses on C# program structure, language syntax, and implementation details with.net

More information

Fundamental C# Programming

Fundamental C# Programming Part 1 Fundamental C# Programming In this section you will find: Chapter 1: Introduction to C# Chapter 2: Basic C# Programming Chapter 3: Expressions and Operators Chapter 4: Decisions, Loops, and Preprocessor

More information

Variable Scope The Main() Function Struct Functions Overloading Functions Using Delegates Chapter 7: Debugging and Error Handling Debugging in Visual

Variable Scope The Main() Function Struct Functions Overloading Functions Using Delegates Chapter 7: Debugging and Error Handling Debugging in Visual Table of Contents Title Page Introduction Who This Book Is For What This Book Covers How This Book Is Structured What You Need to Use This Book Conventions Source Code Errata p2p.wrox.com Part I: The OOP

More information

Introduction to Microsoft.NET Framework Programming using VS 2005 (C#)

Introduction to Microsoft.NET Framework Programming using VS 2005 (C#) Introduction to Microsoft.NET Framework Programming using VS 2005 (C#) Course Length: 5 Days Course Overview This instructor-led course teaches introductory-level developers who are not familiar with the

More information

CHAPTER 1: INTRODUCTION TO THE IDE 3

CHAPTER 1: INTRODUCTION TO THE IDE 3 INTRODUCTION xxvii PART I: IDE CHAPTER 1: INTRODUCTION TO THE IDE 3 Introducing the IDE 3 Different IDE Appearances 4 IDE Configurations 5 Projects and Solutions 6 Starting the IDE 6 Creating a Project

More information

"Charting the Course... MOC Programming in C# with Microsoft Visual Studio Course Summary

Charting the Course... MOC Programming in C# with Microsoft Visual Studio Course Summary Course Summary NOTE - The course delivery has been updated to Visual Studio 2013 and.net Framework 4.5! Description The course focuses on C# program structure, language syntax, and implementation details

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.)

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) INTRODUCTION TO.NET Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate Language (IL) Just- In-

More information

Advanced Object-Oriented Programming. 11 Features. C# Programming: From Problem Analysis to Program Design. 4th Edition

Advanced Object-Oriented Programming. 11 Features. C# Programming: From Problem Analysis to Program Design. 4th Edition 11 Features Advanced Object-Oriented Programming C# Programming: From Problem Analysis to Program Design C# Programming: From Problem Analysis to Program Design 1 4th Edition Chapter Objectives Learn the

More information

Dot Net Online Training

Dot Net Online Training chakraitsolutions.com http://chakraitsolutions.com/dotnet-online-training/ Dot Net Online Training DOT NET Online Training CHAKRA IT SOLUTIONS TO LEARN ABOUT OUR UNIQUE TRAINING PROCESS: Title : Dot Net

More information

Deitel Series Page How To Program Series

Deitel Series Page How To Program Series Deitel Series Page How To Program Series Android How to Program C How to Program, 7/E C++ How to Program, 9/E C++ How to Program, Late Objects Version, 7/E Java How to Program, 9/E Java How to Program,

More information

.Net. Course Content ASP.NET

.Net. Course Content ASP.NET .Net Course Content ASP.NET INTRO TO WEB TECHNOLOGIES HTML ü Client side scripting langs ü lls Architecture ASP.NET INTRODUCTION ü What is ASP.NET ü Image Technique and code behind technique SERVER SIDE

More information

Getting started 7. Storing values 21. Creating variables 22 Reading input 24 Employing arrays 26 Casting data types 28 Fixing constants 30 Summary 32

Getting started 7. Storing values 21. Creating variables 22 Reading input 24 Employing arrays 26 Casting data types 28 Fixing constants 30 Summary 32 Contents 1 2 3 Contents Getting started 7 Introducing C# 8 Installing Visual Studio 10 Exploring the IDE 12 Starting a Console project 14 Writing your first program 16 Following the rules 18 Summary 20

More information

B.E /B.TECH DEGREE EXAMINATIONS,

B.E /B.TECH DEGREE EXAMINATIONS, B.E /B.TECH DEGREE EXAMINATIONS, November / December 2012 Seventh Semester Computer Science and Engineering CS2041 C# AND.NET FRAMEWORK (Common to Information Technology) (Regulation 2008) Time : Three

More information

MCSA Universal Windows Platform. A Success Guide to Prepare- Programming in C# edusum.com

MCSA Universal Windows Platform. A Success Guide to Prepare- Programming in C# edusum.com 70-483 MCSA Universal Windows Platform A Success Guide to Prepare- Programming in C# edusum.com Table of Contents Introduction to 70-483 Exam on Programming in C#... 2 Microsoft 70-483 Certification Details:...

More information

Introduction to C++/CLI 3. What C++/CLI can do for you 6 The rationale behind the new syntax Hello World in C++/CLI 13

Introduction to C++/CLI 3. What C++/CLI can do for you 6 The rationale behind the new syntax Hello World in C++/CLI 13 contents preface xv acknowledgments xvii about this book xix PART 1 THE C++/CLI LANGUAGE... 1 1 Introduction to C++/CLI 3 1.1 The role of C++/CLI 4 What C++/CLI can do for you 6 The rationale behind the

More information

EEE-425 Programming Languages (2013) 1

EEE-425 Programming Languages (2013) 1 2 Computer programming: creating a sequence of instructions to enable the computer to do something Programmers do not use machine language when creating computer programs. Instead, programmers tend to

More information

The Microsoft.NET Framework

The Microsoft.NET Framework Microsoft Visual Studio 2005/2008 and the.net Framework The Microsoft.NET Framework The Common Language Runtime Common Language Specification Programming Languages C#, Visual Basic, C++, lots of others

More information

Visual C# 2008 How to Program, 3/E Outline

Visual C# 2008 How to Program, 3/E Outline vcsharp2008htp_outline.fm Page ix Monday, December 17, 2007 4:39 PM Visual C# 2008 How to Program, 3/E Outline ( subject to change) current as of 12/17/07. As the contents change, we ll post updates at

More information

PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore

PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore 560 100 Department of MCA COURSE INFORMATION SHEET Programming Using C#.NET (13MCA53) 1. GENERAL INFORMATION: Academic Year:

More information

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime Intro C# Intro C# 1 Microsoft's.NET platform and Framework.NET Enterprise Servers Visual Studio.NET.NET Framework.NET Building Block Services Operating system on servers, desktop, and devices Web Services

More information

Introduction to Programming Microsoft.NET Framework Applications with Microsoft Visual Studio 2005 (C#)

Introduction to Programming Microsoft.NET Framework Applications with Microsoft Visual Studio 2005 (C#) Introduction to Programming Microsoft.NET Framework Applications with Microsoft Visual Studio 2005 (C#) Course Number: 4994A Length: 3 Day(s) Certification Exam There are no exams associated with this

More information

IT 374 C# and Applications/ IT695 C# Data Structures

IT 374 C# and Applications/ IT695 C# Data Structures IT 374 C# and Applications/ IT695 C# Data Structures Module 2.1: Introduction to C# App Programming Xianrong (Shawn) Zheng Spring 2017 1 Outline Introduction Creating a Simple App String Interpolation

More information

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET Chapter. 03 9/17/01 6:08 PM Page 35 Visual Studio.NET T H R E E Although it is possible to program.net using only the command line compiler, it is much easier and more enjoyable to use Visual Studio.NET.

More information

DEPARTMENT OF INFORMATION TECHNOLOGY Academic Year 2015-2016 QUESTION BANK-EVEN SEMESTER NAME OF THE SUBJECT SUBJECT CODE SEMESTER YEAR DEPARTMENT C# and.net Programming CS6001 VI III IT UNIT 1 PART A

More information

S.Sakthi Vinayagam Sr. AP/CSE, C.Arun AP/IT

S.Sakthi Vinayagam Sr. AP/CSE, C.Arun AP/IT Chettinad College of Engineering & Technology CS2014 C# &.NET Framework Part A Questions Unit I 1. Define Namespace. What are the uses of Namespace? A namespace is designed for providing a way to keep

More information

Chapters are PDF documents posted online at the book s Companion Website (located at

Chapters are PDF documents posted online at the book s Companion Website (located at vbhtp6printonlytoc.fm Page ix Wednesday, February 27, 2013 11:59 AM Chapters 16 31 are PDF documents posted online at the book s Companion Website (located at www.pearsonhighered.com/deitel/). Preface

More information

Chapters and Appendix F are PDF documents posted online at the book s Companion Website (located at

Chapters and Appendix F are PDF documents posted online at the book s Companion Website (located at Contents Chapters 16 27 and Appendix F are PDF documents posted online at the book s Companion Website (located at www.pearsonhighered.com/deitel/). Preface Before You Begin xix xxix 1 Introduction to

More information

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class.

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class. 1. What is C#? C# (pronounced "C sharp") is a simple, modern, object oriented, and type safe programming language. It will immediately be familiar to C and C++ programmers. C# combines the high productivity

More information

Learning to Program in Visual Basic 2005 Table of Contents

Learning to Program in Visual Basic 2005 Table of Contents Table of Contents INTRODUCTION...INTRO-1 Prerequisites...INTRO-2 Installing the Practice Files...INTRO-3 Software Requirements...INTRO-3 Installation...INTRO-3 Demonstration Applications...INTRO-3 About

More information

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server Chapter 3 SQL Server Management Studio In This Chapter c Introduction to SQL Server Management Studio c Using SQL Server Management Studio with the Database Engine c Authoring Activities Using SQL Server

More information

Department of Computer Applications

Department of Computer Applications MCA 512:.NET framework and C# [Part I : Medium Answer type Questions] Unit - 1 Q1. What different tools are available and used to develop.net Applications? Hint a).net Framework SDK b) ASP.NET Web Matrix

More information

Objective of the Course: (Why the course?) Brief Course outline: (Main headings only) C# Question Bank Chapter1: Philosophy of.net

Objective of the Course: (Why the course?) Brief Course outline: (Main headings only) C# Question Bank Chapter1: Philosophy of.net Objective of the Course: (Why the course?) To provide a brief introduction to the.net platform and C# programming language constructs. Enlighten the students about object oriented programming, Exception

More information

Apex TG India Pvt. Ltd.

Apex TG India Pvt. Ltd. (Core C# Programming Constructs) Introduction of.net Framework 4.5 FEATURES OF DOTNET 4.5 CLR,CLS,CTS, MSIL COMPILER WITH TYPES ASSEMBLY WITH TYPES Basic Concepts DECISION CONSTRUCTS LOOPING SWITCH OPERATOR

More information

Microsoft Visual Studio 2010

Microsoft Visual Studio 2010 Microsoft Visual Studio 2010 A Beginner's Guide Joe Mayo Mc Grauu Hill New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto Contents ACKNOWLEDGMENTS

More information

Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#)

Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#) Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#) Course Number: 6367A Course Length: 3 Days Course Overview This three-day course will enable students to start designing

More information

C#: framework overview and in-the-small features

C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

10/9/2012. Sample C# program:

10/9/2012. Sample C# program: Creating and Running Your First C# Program Text Book : C# Programming From Problem Analysis to Program design, Barbara Doyle Grading : Homeworks 20% Lecture Presentation 20% Final : % 20 Project : 40%

More information

"Charting the Course to Your Success!" MOC B Programming in C# Course Summary

Charting the Course to Your Success! MOC B Programming in C# Course Summary Course Summary Description This training course teaches developers the programming skills that are required for developers to create Windows applications using the C# language. During their five days in

More information

DOT NET COURSE BROCHURE

DOT NET COURSE BROCHURE Page 1 1Pointer Technology Chacko Towers,Anna nagar Main Road, Anna Nager(Annai Insititute 2nd Floor) Pondicherry-05 Mobile :+91-9600444787,9487662326 Website : http://www.1pointer.com/ Email : info@1pointer.com/onepointertechnology@gmail.com

More information

Object-Oriented Programming in Visual Basic

Object-Oriented Programming in Visual Basic Object-Oriented Programming in Visual Basic Student Guide Revision 4.0 Object Innovations Course 4201 Object-Oriented Programming in Visual Basic Rev. 4.0 Student Guide Information in this document is

More information

Diploma in Microsoft.NET

Diploma in Microsoft.NET Course Duration For Microsoft.NET Training Course : 12 Weeks (Weekday Batches) Objective For Microsoft.NET Training Course : To Become a.net Programming Professional To Enable Students to Improve Placeability

More information

Creating and Running Your First C# Program

Creating and Running Your First C# Program Creating and Running Your First C# Program : http://eembdersler.wordpress.com Choose the EEE-425Programming Languages (Fall) Textbook reading schedule Pdf lecture notes Updated class syllabus Midterm and

More information

EEE-425 Programming Languages (2013) 1

EEE-425 Programming Languages (2013) 1 Creating and Running Your First C# Program : http://eembdersler.wordpress.com Choose the EEE-425Programming Languages (Fall) Textbook reading schedule Pdf lecture notes Updated class syllabus Midterm and

More information

Murach s Beginning Java with Eclipse

Murach s Beginning Java with Eclipse Murach s Beginning Java with Eclipse Introduction xv Section 1 Get started right Chapter 1 An introduction to Java programming 3 Chapter 2 How to start writing Java code 33 Chapter 3 How to use classes

More information

ASP.NET Web Forms Programming Using Visual Basic.NET

ASP.NET Web Forms Programming Using Visual Basic.NET ASP.NET Web Forms Programming Using Visual Basic.NET Duration: 35 hours Price: $750 Delivery Option: Attend training via an on-demand, self-paced platform paired with personal instructor facilitation.

More information

Introducing C# and the.net Framework

Introducing C# and the.net Framework 1 Introducing C# and the.net Framework C# is a general-purpose, type-safe, object-oriented programming language. The goal of the language is programmer productivity. To this end, the language balances

More information

C#.NET TRAINING / /

C#.NET TRAINING / / C#.NET TRAINING.NET ENTERPRISE ARCHITECTURE Introduction to the.net platform Common Language Run Time(CLR) The Common Type Specification(CTS) The Common Language Specification(CLS) Microsoft Intermediate

More information

Programming C# 5.0. Ian Griffiths O'REILLY' Beijing Cambridge * Farnham Kbln Sebastopol Tokyo

Programming C# 5.0. Ian Griffiths O'REILLY' Beijing Cambridge * Farnham Kbln Sebastopol Tokyo Programming C# 5.0 Ian Griffiths O'REILLY' Beijing Cambridge * Farnham Kbln Sebastopol Tokyo Preface xvii 1. Introducing C# 1 Why C#? 1 Why Not C#? 3 C#'s Defining Features 5 Managed Code and the CLR 7

More information

Migrate Your Skills to Microsoft.NET Framework 2.0 and 3.0 using Visual Studio 2005 (C#)

Migrate Your Skills to Microsoft.NET Framework 2.0 and 3.0 using Visual Studio 2005 (C#) Migrate Your Skills to Microsoft.NET Framework 2.0 and 3.0 using Visual Studio 2005 (C#) Course Length: 5 Days Course Overview This instructor-led course teaches developers to gain in-depth guidance on

More information

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations , 1 C#.Net VT 2009 Course Contents C# 6 hp approx. BizTalk 1,5 hp approx. No exam, but laborations Course contents Architecture Visual Studio Syntax Classes Forms Class Libraries Inheritance Other C# essentials

More information

ADO.NET 2.0. database programming with

ADO.NET 2.0. database programming with TRAINING & REFERENCE murach s ADO.NET 2.0 database programming with (Chapter 3) VB 2005 Thanks for downloading this chapter from Murach s ADO.NET 2.0 Database Programming with VB 2005. We hope it will

More information

Developing Desktop Apps for Ultrabook Devices in Windows 8*: Getting Started

Developing Desktop Apps for Ultrabook Devices in Windows 8*: Getting Started Developing Desktop Apps for Ultrabook Devices in Windows 8*: Getting Started By Paul Ferrill The Ultrabook provides a rich set of sensor capabilities to enhance a wide range of applications. It also includes

More information

ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p.

ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p. Preface p. xix ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p. 6 Personalization p. 6 Master Pages p. 6 Navigation p.

More information

C# 6.0 in a nutshell / Joseph Albahari & Ben Albahari. 6th ed. Beijin [etc.], cop Spis treści

C# 6.0 in a nutshell / Joseph Albahari & Ben Albahari. 6th ed. Beijin [etc.], cop Spis treści C# 6.0 in a nutshell / Joseph Albahari & Ben Albahari. 6th ed. Beijin [etc.], cop. 2016 Spis treści Preface xi 1. Introducing C# and the.net Framework 1 Object Orientation 1 Type Safety 2 Memory Management

More information

HOUR 4 Understanding Events

HOUR 4 Understanding Events HOUR 4 Understanding Events It s fairly easy to produce an attractive interface for an application using Visual Basic.NET s integrated design tools. You can create beautiful forms that have buttons to

More information

20483BC: Programming in C#

20483BC: Programming in C# 20483BC: Programming in C# Course length: 5 day(s) Course Description The goal of this course is to help students gain essential C# programming skills. This course is an entry point into the Windows Store

More information

A Quick Tour GETTING STARTED WHAT S IN THIS CHAPTER?

A Quick Tour GETTING STARTED WHAT S IN THIS CHAPTER? 1 A Quick Tour WHAT S IN THIS CHAPTER? Installing and getting started with Visual Studio 2012 Creating and running your fi rst application Debugging and deploying an application Ever since software has

More information

.Net Technologies. Components of.net Framework

.Net Technologies. Components of.net Framework .Net Technologies Components of.net Framework There are many articles are available in the web on this topic; I just want to add one more article over the web by explaining Components of.net Framework.

More information

Uka Tarsadia University MCA ( 3rd Semester)/M.Sc.(CA) (1st Semester) Course : / Visual Programming Question Bank

Uka Tarsadia University MCA ( 3rd Semester)/M.Sc.(CA) (1st Semester) Course : / Visual Programming Question Bank Unit 1 Introduction to.net Platform Q: 1 Answer in short. 1. Which three main components are available in.net framework? 2. List any two new features added in.net framework 4.0 which is not available in

More information

How to be a C# ninja in 10 easy steps. Benjamin Day

How to be a C# ninja in 10 easy steps. Benjamin Day How to be a C# ninja in 10 easy steps Benjamin Day Benjamin Day Consultant, Coach, Trainer Scrum.org Classes Professional Scrum Developer (PSD) Professional Scrum Foundations (PSF) TechEd, VSLive, DevTeach,

More information

Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500

Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500 Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500 Summary Each day there will be a combination of presentations, code walk-throughs, and handson projects. The final project

More information

To get started with Visual Basic 2005, I recommend that you jump right in

To get started with Visual Basic 2005, I recommend that you jump right in In This Chapter Chapter 1 Wading into Visual Basic Seeing where VB fits in with.net Writing your first Visual Basic 2005 program Exploiting the newfound power of VB To get started with Visual Basic 2005,

More information

UNIT 1 PART A PART B

UNIT 1 PART A PART B UNIT 1 PART A 1. List some of the new features that are unique to c# language? 2. State few words about the two important entities of.net frame work 3. What is.net? Name any 4 applications that are supported

More information

Getting Started with Web Services

Getting Started with Web Services Getting Started with Web Services Getting Started with Web Services A web service is a set of functions packaged into a single entity that is available to other systems on a network. The network can be

More information

CHAPTER 1: VISUAL STUDIO

CHAPTER 1: VISUAL STUDIO INTRODUCTION xxxi PART I: LANGUAGE CONSTRUCTS AND ENVIRONMENT CHAPTER 1: VISUAL STUDIO 2012 3 Visual Studio 2012 4 Visual Basic Keywords and Syntax 5 Console Applications 10 Creating a Project from a Project

More information

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN Contents Contents 5 About the Author 12 Introduction 13 Conventions used in this book 14 1 The Visual Studio C# Environment 15 1.1 Introduction 15 1.2 Obtaining the C# software 15 1.3 The Visual Studio

More information

C# Programming. Unit 1: Introducing C# and the.net FrameworkThis module explains the.net Framework, and using C# and

C# Programming. Unit 1: Introducing C# and the.net FrameworkThis module explains the.net Framework, and using C# and C# Programming 1. Sound Knowledge of C++. Course Summary: This course presents Microsoft's C# programming language and the use of Visual Studio 2008 or 2010 to develop Windows applications using the.net

More information

EVALUATION COPY. Test-Driven Development Using NUnit and C# Student Guide Revision 4.6. Unauthorized reproduction or distribution is prohibited.

EVALUATION COPY. Test-Driven Development Using NUnit and C# Student Guide Revision 4.6. Unauthorized reproduction or distribution is prohibited. Test-Driven Development Using NUnit and C# Student Guide Revision 4.6 Object Innovations Course 4105 Test-Driven Development Using NUnit and C# Rev. 4.6 Student Guide Information in this document is subject

More information

Getting started 7. Setting properties 23

Getting started 7. Setting properties 23 Contents 1 2 3 Getting started 7 Introducing Visual Basic 8 Installing Visual Studio 10 Exploring the IDE 12 Starting a new project 14 Adding a visual control 16 Adding functional code 18 Saving projects

More information

C++/CLI in Action NISHANT SIVAKUMAR MANNING. Greenwich (74 w. long.)

C++/CLI in Action NISHANT SIVAKUMAR MANNING. Greenwich (74 w. long.) C++/CLI in Action NISHANT SIVAKUMAR 11 MANNING Greenwich (74 w. long.) brief contents PART 1 THE C++/CLI LANGUAGE 1 1 IntroductiontoC++/CLI 3 2 Getting into the CLI: properties, delegates and arrays 46

More information

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( )

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( ) SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM (2013-2014) MODULE: C# PROGRAMMING CHAPTER 1: INTRODUCING.NET AND C# 1.1 INTRODUCTION TO LANGUAGES C++ C# DIFFERENCES BETWEEN

More information