Web Services Week 2 Aims: Getting started with creating simple C# applications within Visual Studio.NET Objectives: –An introduction to the syntax of C#.NET.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Getting Started with VB .NET
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
GTECH 731 Lab Session 2 Lab 1 Review, Lab 2 Intro 9/6/10 Lab 1 Review Lab 2 Overview.
1 Web Services Visual C# 2008 Step by Step Chapter 30.
From C++ to C#. Web programming The course is on web programming using ASP.Net and C# The course is on web programming using ASP.Net and C# ASP.Net is.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Getting Started Example ICS2O curriculum
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
A First Program Using C#
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Neal Stublen Overview of.NET Windows Applications Microsoft Windows OS / Intel Platform Windows Application File SystemNetworkDisplay.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Neal Stublen Class Objectives  Develop an understanding of the.NET Framework  Gain proficiency using Visual Studio  Begin learning.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Visual Programming Fall 2012 – FUUAST Topic: Development environment.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
Session 08: Architecture Controllers or Managers Graphical User Interface (GUI) FEN AK - IT Softwarekonstruktion.
Web Services Week 7 Aims: A detailed look at the underlying mechanisms for communication between web services Objectives: SOAP, WSDL, UDDI.
2. Introduction to the Visual Studio.NET IDE. Chapter Outline Overview of the Visual Studio.NET IDE Overview of the Visual Studio.NET IDE Menu Bar and.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 13: An Introduction to C++
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Introduction to the Visual Studio.NET IDE (LAB 1 )
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction In The Name Of Allah, The Beneficent, The Merciful.
FIRST GADGETEER PROJECT. Where are you? Making a VS project Parts of a C# program Basics of C# syntax Debugging in VS Questions? 2.
Sample Application Multi Layered Architecture (n-tier): –Graphical User Interface (GUI): Forms, components, controls The Visual Designer in Visual Studio.
VB and C# Programming Basics. Overview Basic operations String processing Date processing Control structures Functions and subroutines.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
Introduction to Windows Programming
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Introduction to Web Services. Examples Using a Web Service Creating a new Web Service.
Introduction to Visual Studio & GUI Programming Prepared by: Ahmad Ramin Rahimee Assistant Professor ICTI.
Applications Development
JDS – VB.NET Skill Session Fall 2004 Presented by YUHAO LIN.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Week Six : Writing Web Services Aims: Creating and Consuming student’s first Web Services Learning Outcomes: Familiarity with VS.NET for creating and consuming.
BIL527 – Bilgisayar Programlama I Introduction 1.
Module 4: Creating a Web Application with Web Forms
Architecture Multi Layered Architecture (n-tier): Application: Model Controllers Database Access Graphical User Interface (GUI): Forms, components, controls.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
.NET Mobile Application Development XML Web Services.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
Module 1 Introducing C# and the.NET Framework. Module Overview Introduction to the.NET Framework 4 Creating Projects Within Visual Studio 2010 Writing.
OOP Basics Classes & Methods (c) IDMS/SQL News
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Chapter 1: Introduction to Computers and Programming.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
C# for C++ Programmers 1.
Chapter 2: The Visual Studio .NET Development Environment
Programming in visual basic .net Visual Basic Building Blocks
Using Procedures and Exception Handling
Module 1: Getting Started
Web Development in Microsoft Visual Studio 2013
Visual Basic..
CS285 Introduction - Visual Basic
Presentation transcript:

Web Services Week 2 Aims: Getting started with creating simple C# applications within Visual Studio.NET Objectives: –An introduction to the syntax of C#.NET –Using objects –The creation solutions using the Visual Studio.NET IDE

Object Orientated Programming Paradigm for nearly all software development Lets programmer use a number of objects that perform the required tasks Objects are instantiated from classes Prewritten classes in hierarchically ordered packages called namespaces

What is C# (pronounced C sharp) Object Orientated Programming Language Syntax very similar to Java and C Optimised for.NET features, e.g. –Managed byte code (safe, tidy and portable) –Run by Microsoft’s Common Language Runtime –Conforms to.NET’s Common Type System –Drag and drop interface and auto code generation

Variables and Arrays Declaring variables in C# int x, y, z; float myVal; double PI; string myString; Declaring arrays in C# float [ ] prime_numbers = new float[10]; double [, ] matrix = new double[3,3];

Operators Assignment operator = For example… x=10; PI=3.1414; myString="hello world"; prime_numbers[0]=1.0f; matrix[2,0]=0.0; Arithmetic operators ( + - * / ) For example… z=x+y; Average=(a+b+c)/3; myString=“ The Value is “ + myValue;

Decision Making Conditional operators == && || > < For example… if(x==10) y=20; else y=3; if(messageStr == "hello" && happy == true) { replyStr = "hello to you too"; } else { replyStr = "be that way"; }

Loops // loop while i less than 10 while(i < 10) { sum = sum + prime_numbers[i]; i = i + 1; } //similar using a ‘for loop’ for(i = 0; i<10;i=i++) { val = prime_numbers[i]; sum = sum + val; }

Methods All methods will be part of a class Can pass values or references… // defining function float MyAdd(float a, float b, ref float sum) { float product; sum=a+b; product=a*b; return product; } //calling function myProduct=MyAdd(1,2,ref mySum);

Classes and Objects Class is a template from which objects can be instantiated

Using a class // head file with namespace containing class definition using MyClasses.MyMathsClasses; // instantiate an object using class MyCalculator calcObj= new MyCalculator(); // access methods via object myVal=calcObj.Add(1,2); Note some classes can be used directly e.g. myVal=Math.Sin(angle);

Handling Events Objects often generate events –e.g. When a button pressed –Event handler method delegated to handle event –Happily much of this code can be auto-generated //delegates method this.button1.Click += new System.EventHandler(this.button1_Click); //method handles the event private void button1_Click(object sender,System.EventArgs e) { // your code here to handle event }

Handling Exceptions Certain methods may generate exceptions (i.e. events caused by errors) Use try and catch to deal with exceptions try { myInputValue=System.Convert.ToDouble(myString); } catch { // code to deal with exception return; }

2.6 Creating your first C# application File->New->Project and select ‘Windows Application’

Key areas of IDE  Design Area – where you will create the user interface for your application and write your source code. Solution Explorer – for viewing constituent files and references that make up your project. Properties Window – can assign values to some objects Toolbox – where you can select from a variety of objects to add to your application. Output Pane – where the IDE sends messages to you (e.g. compile time errors, etc) Index & Search Tags – for viewing and searching for appropriate documentation

Using IntelliSense Can drag and drop some objects onto design area Auto generates code to instantiate objects Can change objects parameters via properties window Can auto generate event handler by double clicking on appropriate object

Task Follow worked example for creating windows application using C# &.NET Complete EXERCISE 2.1 –(miles to kilometres) Complete EXERCIRE 2.2 –(earthquake)

Consuming A Web Service Refer to Web Service Description Language file, e.g. Via Project->Add Web Reference

Hence a proxy class created You can use namespace using ConsumeWebService.com.capescience.live; Hence instantiate objects for class AirportWeather myObject = new AirportWeather(); To access remote data and functionality label1.Text=myObject.getTemperature(textBox1.Text);

Task Complete EXERCISE 2.3 Consume weather service Complete EXERCISE 2.4 Consume other remote XML web services