An Introduction to Application Development in. Microsoft Visual Studio.NET

Similar documents
Microsoft Visual Studio.NET. Anil Mahadev. Database Enthusiast and Oracle User

Building a Library Application From Start to Finish Using Sybase. Power Designer 12.1 With. Visual Studio 2005

Developing an app using Web Services, DB2, and.net

Configuring Microsoft Outlook to Connect to Hosted Exchange Service

Oracle Database Express Edition

Getting Started With the Cisco PAM Desktop Software

If this is the first time you have run SSMS, I recommend setting up the startup options so that the environment is set up the way you want it.

How to Use Serif WebPlus 10

build a digital portfolio in WebPlus X4

CA ERwin Data Modeler

SAP BusinessObjects Live Office User Guide SAP BusinessObjects Business Intelligence platform 4.1 Support Package 2

NTP Software File Reporter Analysis Server

Last Updated: October 12, Learning Ally ReadHear by gh for PC, Quick Start Guide

Q u i c k S ta r t G u i d e

Rocket Network. Quickstart Guide For Cubasis - Inwire

How to Create Tables in MaxDB using SQL Studio

Welcome To Account Manager 2.0

Tivoli Common Reporting V Cognos report in a Tivoli Integrated Portal dashboard

Centra Workbench (V3.12 onwards)

Installing Your Software Important:

Contents 1. Table of Contents. Report Server (Home Page) Installation. Manage Reports DevExpress Inc.

8x8 Virtual Office Sage ACT! Integration User Guide

How to Get Started. Figure 3

Version Installation Guide. 1 Bocada Installation Guide

Getting started 7. Setting properties 23

IBM DB Getting started with Data Studio Hands-On Lab. Information Management Cloud Computing Center of Competence.

Administrator s Guide

JUNE 2016 PRIMAVERA P6 8x, CONTRACT MANAGEMENT 14x AND UNIFIER 16x CREATING DASHBOARD REPORTS IN ORACLE BI PUBLISHER

Getting Started with Team Coding Applicable to Toad for Oracle Suite 2016 (v12.9) and higher

QW5 - Remote Access Data Server

You can use Dreamweaver to build master and detail Web pages, which

Desktop and Professional Editions

Workspace Administrator Help File

Remote Desktop How to guide

Connecting BioNumerics to MySQL

Introducing Rational ClearQuest

MicroStrategy Academic Program

TUTORIALS > DIAGRAM NAVIGATION AND AESTHETICS

User Guide Part 11. Tools and Utilities

ER/Studio Business Architect

Installation Guide for 3.1.x

MySQL for Visual Studio

InventoryControl Quick Start Guide

UC for Enterprise (UCE) NEC Centralized Authentication Service (NEC CAS)

CA ERwin Data Modeler

Vision Document. Online E-commerce Music CD Store Version 2.0

Creating a 2 node virtual SQL Server 2008 Cluster Configuration Using Windows 2003 MSCS

Connect to Wireless, certificate install and setup Citrix Receiver

Nextiva Drive The Setup Process Mobility & Storage Option

How to use data sources with databases (part 1)

WELCOME TO KIN (KIRKWOOD INFORMATION NETWORK) Initial steps to set up KIN on your computer.

Style Report Enterprise Edition

Table of Contents. Table of Contents

Checkbox Quick Start Guide

FrontBase An Omnis Studio Application

DATABASES 1.0 INTRODUCTION 1.1 OBJECTIVES

Product Documentation. ER/Studio Portal. User Guide. Version Published February 21, 2012

Simple sets of data can be expressed in a simple table, much like a

Developing portlets for the IBM WebSphere Portal Server with IBM Rational Rapid Developer

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

LEARNING ABOUT TAXES WITH INTUIT PROFILE: 2016 TY Chapter 8 Exploring ProFile cont d

Applied ICT Skills MS Windows

Optional Lab. Identifying the Requirements. Configuring Windows 7 with virtualization. Installing Windows Server 2008 on a virtual machine

GRS Enterprise Synchronization Tool

Using SAP NetWeaver Business Intelligence in the universe design tool SAP BusinessObjects Business Intelligence platform 4.1

Borland StarTeam Toolbar Utility Help

External Data Connector for SharePoint

Alchemex. Web Reporting. Learning Services Alchemex Web Module

Prophet 21 Middleware Installation Guide. version 12.16

Enterprise Vault.cloud CloudLink Google Account Synchronization Guide. CloudLink to 4.0.3

Microsoft FrontPage 2003 The Basics

UC for Enterprise (UCE) Emergency On-Site Notification (E-OSN)

Certified Enterprise Applications Integration Specialist (With Microsoft BizTalk Server) Sample Material

TABLE OF CONTENTS PAGE

TABLE OF CONTENTS. Getting Started Guide

UC for Enterprise (UCE) Emergency On Site Notification (E-OSN)

Multi-NVR Manager. Quick Start Configuration Usage

USER GUIDE. We hope you enjoy using the product, and please don t hesitate to send us questions or provide feedback at Thank You.

[ Getting Started with Analyzer, Interactive Reports, and Dashboards ] ]

CodeWarrior Development Tools mwclearcase Plug-in User s Guide

Downloading, Installing, and Configuring Blackboard Drive

Introduction to using Visual Studio 2010 to build data-aware applications

Partner Integration Portal (PIP) Installation Guide

Oracle SQL. murach s. and PL/SQL TRAINING & REFERENCE. (Chapter 2)

Quick KVM 1.1. User s Guide. ClearCube Technology, Inc.

Using Tableau to report on SharePoint lists and libraries: A step by step guide

Introduction The goal of this article is to clarify a few questions about Oracle's installation and its many different available modules.

CENTAUR S REAL-TIME GRAPHIC INTERFACE V4.0 OPERATOR S MANUAL

ICS Tutorials: Basic Operations

Installing Lotus Notes on Your Computer Lotus Notes release (Standard and Basic versions)

The Citrix receiver will allow you access to Komatsu business systems such as Merchand, K-Source and Intranet.

Print Manager Plus 2010 Workgroup Print Tracking and Control

Operating Instructions

IDERA ER/Studio Business Architect Quick Start Guide. Version 17.0 Published August 2017

Using the IMS Explorer with the IMS Catalog Hands-on Lab

USER GUIDE Deployment

NVMS User Manual. Version 2.1.0

INTRODUCTION TO VISUAL BASIC 2010

Server Installation Guide

SharePoint 2010 Site Owner s Manual by Yvonne M. Harryman

Transcription:

An Introduction to Application Development in IBM DB2 UDB using Microsoft Visual Studio.NET By Anil Mahadev Database Technologist and Enthusiast In this tutorial, I will dive into the nitty gritties of DB2 Application Development using the DB2 Addin for Visual Studio.NET and build a simple Database Application using VC# and IBM DB2 UDB. This tutorial is a Level 100 session, which means that basic knowledge of the products is necessary. System Requirements: A basic P4 Machine with 512 MB RAM and about 20 GB HDD, a pointing device, A keyboard and a monitor. Software Requirements 1) Windows 2000 and above. 2) A personal copy of DB2 UDB (Any edition will do, as I am still developing for test purposes only, I will be using the Personal Edition of DB2 UDB 8.1 for Windows. 3) Microsoft Visual Studio.NET 2003(Professional, Enterprise Developer or Enterprise Architect). 4) Install the DB2 Addin, once you have completed the Installation of DB2 UDB. 5) Finally the urge to learn new things and adapt accordingly.

As this tutorial is going to be fully practical, attention to detail is always necessary. If you do not understand a particular step, please go ahead and try it, until you get it right. So what are we waiting for, let s develop a simple database application using the tools mentioned above, to create an Employee Management System that views employee details. So lets Begin (Note: Hereafter I will be referring to Visual Studio.NET as VS.NET) Firstly for those of you who have not installed the DB2 Addin for VS.NET, you can follow these steps.

Click on Start Programs IBM DB2 Setup Tools Register Visual Studio Addins as shown in Fig 1.1 It will then open a command prompt window stating that the Addins were installed successfully. Now that part is done, we now need to start a new DB2 project within VS.NET. To do that, start VS.NET from your machine and you will notice a new icon mentioned as DB2 Tools, will be visible along with the remaining languages, you have installed.

Now let s give our project a sensible name, such as EmployeeApp as shown in Fig 1.2.

Next we get the following Screen by default as shown in Fig 1.3 U may notice a new toolbar appears in your IDE. This toolbar is called the IBM DB2 Toolbar. For your convenience for viewing, I have dragged the toolbar below the form. NOTE: (This tool isn t just a few icons up there; it acts as an interface between your DB2 Client tools and your DB2 Server. You can launch the Control center within VS.NET using this toolbar, instead of going through the traditional way to launch it.)

We are now going to start building our Application. Step 1: Establish a connection to the Database using the Appropriate Connection, Data Adapter and build our Application. Since I have designed this tutorial for newbies, those who are just getting their hands dirty, I shall be using the DB2 Data Adapter Control. So let us now build our Database Connection and fetch the Employees Table from the SAMPLE Database provided by DB2 UDB. Now, drag and drop a DB2 Data Adapter onto your form. Next rename the DataAdapter to db2adp, under the properties window. Now click on Configure Data Adapter. We are presented with the DB2 Data Adapter Configuration Wizard as shown in Fig 1.4 Follow the instructions as given from now on.

Please remember, depending on the permissions set by your DBA, you will be able to access the respective Database Objects. Click on Next You will be presented with the following screen. We are now going to specify the parameters for each one. Since you have not established a connection yet. Please do so immediately.

Click on New Connection Button and you will be presented with the main connection parameters dialog, where you will specify the following details Connection Name: This is your connection name. (Your Database Name becomes you connection name) Database Alias: You can specify the Database you wish to connect. In this case we shall connect to the SAMPLE Database. User Name: This is your db2 username. (Use your credentials). Password: This is your db2 password. (Use your credentials). Now click on Test Connection. You should get the following result as from the Fig 1.5

Next Deselect all the default options as shown in Fig 1.6; since we are only going to display data, I have another interactive tutorial in stored for that purpose. Next we are presented with a query editor that allows us to enter custom SQL Statements.

Since we would like the details of all Employees, please give the following query. SELECT * FROM DATABASEARCHITECT.EMPLOYEE AS EMPLOYEE; Here please replace DATABASEARCHITECT with your Schema and User credentials. The query should be like in fig 1.8 Click Next

As you can see in Fig 1.10, the Finish screen appears with all the parameters. Click Finish and you re done configuring your DB2 Database to listen to your application now. As you will notice, two new icons will appear on the screen, they are your db2adp and your DB2 Connection objects.

As we all know, we need to create a Dataset. For those of you, who don t know what a dataset is, it is an in memory database, that stores the database related information even after the connection is being lost from the database. Now right click on your DataAdapter and say generate Dataset as shown in Fig 1.11 and Fig 1.12. Rename your Dataset to DB2DS1 for simplicity. We have now completed the task of configuring our Data Adapter, creating a Dataset from it and successfully establishing a connection to the SAMPLE Database.

For this tutorial, I am going to place a Data Grid Control on to the Form and we are going to display the employee records when the Form is loaded. 1) Add a Data Grid on to the Form and Set its Dock property to Fill. Set its Data Source = db2ds11 and for Data Member = EMPLOYEE. Then set the Forms Startup Position = Center Screen and Border Style = Fixed Single. Next Open the Code window and type the following code in the Form_Load Event. (I shall be using C# for this tutorial); //Fill the Data Adapter db2adp.fill(db2ds11); //Set the Data Source of the DataGrid to the DataSet datagrid1.datasource = db2ds11; //Now bind the DataGrid with the Binding Option to display Employee Details from the Employee Table datagrid1.setdatabinding(db2ds11,"employee");

Now let s run the Application by pressing f5. 2) And let DB2 and.net work Magic for you as you see in Figure 1.13 Voila!!! Now wasn t that easy. In my next series, I shall be diving into the various powers of DB2 and.net combined using Stored Procedures, Triggers, the only difference will be that, I will be developing an ASP.NET Web Application and Web Service that interact with a DB2 UDB Database. Well folks this was a very short introduction to DB2 using.net, hope you have found this article fun learning, as much as I have writing it. Please feel free to mail me your comments and valuable inputs on how I can write better in DB2 and.net.

You can reach me @ Anil Mahadev databasearchitect@gmail.com IBM DB2 UDB Logo is Copyright of IBM (International Business Machines) Corporation, USA and other International Countries where present. Microsoft Windows and Microsoft Visual Studio.NET logo are copyright of Microsoft Corporation, USA and other International Countries where present.