Introduction to Visual Basic and Visual C++ Database Foundation. Types of Databases. Data Access Application Models. Introduction to Database System



Similar documents
Creating Reports Using Crystal Reports

CRYSTAL REPORTS IN VISUAL STUDIO.NET 2003

How To: Create a Crystal Report from ADO.NET Dataset using Visual Basic.NET

1. Create SQL Database in Visual Studio

Programming in C# with Microsoft Visual Studio 2010

Crystal Reports. For Visual Studio.NET. Reporting Off ADO.NET Datasets

Business Insight Report Authoring Getting Started Guide

Producing Listings and Reports Using SAS and Crystal Reports Krishna (Balakrishna) Dandamudi, PharmaNet - SPS, Kennett Square, PA

Hands-On Lab. Building a Data-Driven Master/Detail Business Form using Visual Studio Lab version: Last updated: 12/10/2010.

SQL Server for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

New 11g Features in Oracle Developer Tools for Visual Studio. An Oracle White Paper January 2008

SAP BO 4.1 COURSE CONTENT

CHAPTER 6: ANALYZE MICROSOFT DYNAMICS NAV 5.0 DATA IN MICROSOFT EXCEL

SQL Server Administrator Introduction - 3 Days Objectives

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

Crystal Converter User Guide

Deleting A Record Updating the Database Binding Data Tables to Controls Binding the Data Table to the Data Grid View...

A SharePoint Developer Introduction. Hands-On Lab. Lab Manual SPCHOL306 Using Silverlight with the Client Object Model VB

ER/Studio 8.0 New Features Guide

Microsoft Query, the helper application included with Microsoft Office, allows

Microsoft' Excel & Access Integration

How To Create A Report In Excel

Introduction to Visual Basic

Financial Reporting Budgeting Consolidations Financial Modeling

1. INTRODUCTION TO RDBMS

Toad for Data Analysts, Tips n Tricks

Vendor: Crystal Decisions Product: Crystal Reports and Crystal Enterprise

Access 2007 Creating Forms Table of Contents

Technical White Paper. Automating the Generation and Secure Distribution of Excel Reports

CHAPTER 6: TECHNOLOGY

Database Studio is the new tool to administrate SAP MaxDB database instances as of version 7.5.

DataPA OpenAnalytics End User Training

Dynamic Web Programming BUILDING WEB APPLICATIONS USING ASP.NET, AJAX AND JAVASCRIPT

Importing TSM Data into Microsoft Excel using Microsoft Query

SSIS Training: Introduction to SQL Server Integration Services Duration: 3 days

Transition your MCPD Web Developer Skills to MCPD ASP.NET Developer 3.5 (VB)

Visual COBOL ASP.NET Shopping Cart Demonstration

Developing and Implementing Web Applications with Microsoft Visual C#.NET and Microsoft Visual Studio.NET

DataDirect XQuery Technical Overview

Reporting with Pentaho. Gabriele Pozzani

TechTips. Connecting Xcelsius Dashboards to External Data Sources using: Web Services (Dynamic Web Query)

Introduction to Microsoft Access XP

TIM 50 - Business Information Systems

Data processing goes big

Intellect Platform - Tables and Templates Basic Document Management System - A101

Cross Bulk Mailer 6.1 User Guide

Monitoring Replication

A Basic introduction to Microsoft Access

Cross Bulk Mailer 5.4 User Guide

Consider the possible problems with storing the following data in a spreadsheet:

Developing a Three Tier Web Application Using ASP.NET and Open Source Object-Oriented Database DB4Objects

Intermediate ASP.NET Web Development with C# Instructor: Frank Stepanski. Data Sources on the Web

Access Queries (Office 2003)

Application Developer Guide

Comparison of Enterprise Reporting Tools

Visual Basic. murach's TRAINING & REFERENCE

What s New: Crystal Reports for Visual Studio 2005

Pastel Evolution BIC. Getting Started Guide

INTRODUCING ORACLE APPLICATION EXPRESS. Keywords: database, Oracle, web application, forms, reports

Pentaho Reporting Overview

BarTender s ActiveX Automation Interface. The World's Leading Software for Label, Barcode, RFID & Card Printing

Performance Management of SQL Server

REP200 Using Query Manager to Create Ad Hoc Queries

Understanding Client/Server Computing

User Manual. Crystal Report Integration

This course will also teach how to create various kinds of dashboards using Reporting Services.

Getting Started Guide

InfoView User s Guide. BusinessObjects Enterprise XI Release 2

Microsoft Office 2010: Access 2010, Excel 2010, Lync 2010 learning assets

ORACLE BUSINESS INTELLIGENCE WORKSHOP

Grupo Lanka s Pivotal Development tools are integrated by the follow individual products:

SAS BI Dashboard 4.3. User's Guide. SAS Documentation

Using Crystal Reports with VFP

- Suresh Khanal. Microsoft Excel Short Questions and Answers 1

Microsoft SQL Server 2005 Reporting Services Step by Step

INFOPATH FORMS FOR OUTLOOK, SHAREPOINT, OR THE WEB

Release 2.1 of SAS Add-In for Microsoft Office Bringing Microsoft PowerPoint into the Mix ABSTRACT INTRODUCTION Data Access

ORACLE BUSINESS INTELLIGENCE WORKSHOP

VB.NET - DATABASE ACCESS

Data Management, Analysis Tools, and Analysis Mechanics

BIA and BO integration other performance management options Crystal Reports Basic: Fundamentals of Report Design

João Diogo Almeida Premier Field Engineer Microsoft Corporation

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

Microsoft Courses. Microsoft Office 2007

COGNOS Query Studio Ad Hoc Reporting

A Brief Introduction to MySQL

Lost in Space? Methodology for a Guided Drill-Through Analysis Out of the Wormhole

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

Comparing Microsoft SQL Server 2005 Replication and DataXtend Remote Edition for Mobile and Distributed Applications

Reporting MDM Data Attribute Inconsistencies for the Enterprise Using DataFlux

2. Building Cross-Tabs in Your Reports Create a Cross-Tab Create a Specified Group Order Filter Cross-Tab by Group Keep Groups Together

BarTender Integration Methods. Integrating BarTender s Printing and Design Functionality with Your Custom Application WHITE PAPER

INTEGRATING MICROSOFT DYNAMICS CRM WITH SIMEGO DS3

for Sage 100 ERP Business Insights Overview Document

IBM Cognos 8 Business Intelligence Analysis Discover the factors driving business performance

A database is a collection of data organised in a manner that allows access, retrieval, and use of that data.

Transcription:

Introduction to Visual Basic and Visual C++ Database Foundation Lesson 8 Introduction to Database System I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Data Access Application Models Types of Databases Evolution of Data Access Client logic Business logic Data storage 1-Tier (monolithic) Fat Client 2-Tier Thin Client 3-Tier N-Tier XML Web service Internet Flat A single table like a spreadsheet Example: Address book Advantage: Simplicity Relational Normalized tables joined using primary and foreign keys Example: Access, SQL Server, Oracle, DB2 Advantage: No duplicated data elements Hierarchical Data is stored in the form it is displayed in Example: XML-based Advantage: Lowest common denominator Network Data stored as some variety of linked lists Example: Almost any really huge database Advantage: Speed of retrieval Object Oriented Lots of stuff besides letters and numbers I154-1-A A @ Peter Lo 2010 3 I154-1-A A @ Peter Lo 2010 4

Database Files A Database is a collection of related information stored in a Structured Format. Here when we refer to a database we mean a Relational Database. A database organizes data in Tables Each row is referred to as a Record Each column in a table is referred to as a Field A unique field is an identifier that represents the Primary Key for the table What is a Connected Environment? A connected environment is one in which users are constantly connected to a data source Advantages: Environment is easier to secure Concurrency is more easily controlled Data is more likely to be current than in other scenarios Disadvantages: Must have a constant network connection Scalability I154-1-A A @ Peter Lo 2010 5 I154-1-A A @ Peter Lo 2010 6 What is a Disconnected Environment? Connected or Disconnected? In a disconnected environment, a subset of data from a central data store can be copied and modified independently, and the changes merged back into the central data store Advantages You can work at any time that is convenient for you, and can connect to a data source at any time to process requests Other users can use the connection A disconnected environment improves the scalability and performance of applications Disadvantages Data is not always up to date Change conflicts can occur and must be resolved Application of Connected Environment If a relatively small number of people are using a relatively small number of relatively local databases all the time, then you can afford to keep connections open. Application of Disconnected Environment If a huge number of people are occasionally using a huge number of frequently distant database, then It s better to open and close the connections each time data is accessed. I154-1-A A @ Peter Lo 2010 7 I154-1-A A @ Peter Lo 2010 8

ADO.NET and XML ADO.NET is tightly integrated with XML Using XML in a disconnected ADO.NET application Client 1 4 5 Request data XML Updated XML XML Web Services DataSet DataSet 2 3 6 SQL query Results SQL updates Data Source Database Connection Connecting to Visual Basic to Database System I154-1-A A @ Peter Lo 2010 9 I154-1-A A @ Peter Lo 2010 10 Data Binding Binding Connecting an object to a control Bound Controls The connected controls DataGridView Control Displays data in row and columnar format, similar to a spreadsheet One of the most popular controls for displaying table data The Copy to Output Directory Property When the Data Source Configuration Wizard connects an application to a database: It adds the database file to the application s project folder Method of saving changes to a local database file Is determined by the file s Copy to Output Directory property I154-1-A A @ Peter Lo 2010 11 I154-1-A A @ Peter Lo 2010 12

How Does Visual Basic Do It? Procedure for Binding an Object? When a table or field object is dragged to the form: Computer adds the appropriate controls and objects to the application A form s Load event Occurs when the application is started and the form is displayed for the first time Load event procedure Code to fill a dataset with data belongs here To bind an object in a dataset to an existing control on the form: Drag the object from the Data Sources window to the control BindingSource object Uses an invisible record pointer to keep track of the current record in the dataset Position property Stores the position of the record pointer I154-1-A A @ Peter Lo 2010 13 I154-1-A A @ Peter Lo 2010 14 Binding Source Object s s Position Property Binding Source Object s s Move Method I154-1-A A @ Peter Lo 2010 15 I154-1-A A @ Peter Lo 2010 16

An Overview of SQL SQL Statement Database Manipulation Language SQL stands for Structured Query Language. It is the most commonly used relational database language today. SQL works with a variety of different fourth-generation (4GL) programming languages, such as Visual Basic. SQL is used for: Data Manipulation Data Definition Data Administration I154-1-A A @ Peter Lo 2010 17 I154-1-A A @ Peter Lo 2010 18 SQL Requirements SQL Must be embedded in a programming language, or used with a 4GL like Visual Basic SQL is a free form language so there is no limit to the the number of words per line or fixed line break. Syntax statements: Words or phrases are always in lower case Keywords are in uppercase. Not all versions are case sensitive! Design SQL represents all information in the form of tables Supports three relational operations: Selection Projection Join. These are for specifying exactly what data you want to display or use SQL is used for data manipulation, definition and administration I154-1-A A @ Peter Lo 2010 19 I154-1-A A @ Peter Lo 2010 20

Table Design Columns describe one characteristic of the entity Data Retrieval (all Records) Name Jane Doe Address 123 Main Street Queries search the database, fetch info, and display it. This is done using the keyword SELECT SELECT * FROM publishers John Smith 456 Second Street pub_id 0736 pub_name New Age Books address 1 1 st Street state MA Mary Poe 789 Third Ave 0987 Binnet & Hardley 2 2 nd Street DC 1120 Algodata Infosys 3 3 rd Street CA Rows describe the Occurrence of an Entity I154-1-A A @ Peter Lo 2010 21 The * Operator asks for every column in the table. I154-1-A A @ Peter Lo 2010 22 Data Retrieval (Specified Record) Queries can be more specific with a few more lines SELECT * from publishers where state = CA pub_id 0736 0987 1120 pub_name New Age Books Binnet & Hardley Algodata Infosys address 1 1 st Street 2 2 nd Street 3 3 rd Street Only publishers in CA are displayed state MA DC CA Insert Record Putting data into a table is accomplished using the keyword INSERT INSERT INTO publishers VALUES ( 0010( 0010, pragmatics, 44 4 th Ln, chicago, il ) pub_id 0736 0010 0987 0736 1120 0987 1120 pub_name New Pragmatics Age Books Binnet New Age & Hardley Books Algodata Binnet & Infosys Hardley Algodata Infosys address 14 14 th st Street Ln 21 21 nd st Street 32 32 rd nd Street 3 3 rd Street Table is updated with new information state MA IL DC MA CA DC CA I154-1-A A @ Peter Lo 2010 23 I154-1-A A @ Peter Lo 2010 24

Update Record To Update information in a database use the UPDATE keyword UPDATE authors SET auth_name= hello hello Crystal Report auth_id auth_name auth_city auth_state 123456789 000000001 Jane HelloDoe John HelloSmith Dearborn Taylor MI MI Create Report for Visual Basic Sets all auth_name fields to hello I154-1-A A @ Peter Lo 2010 25 I154-1-A A @ Peter Lo 2010 26 Introduction to Crystal Report Crystal Report is used to produce professional quality reports/graphs to summarize information. Crystal Report is a report designer by Crystal Decisions available in Visual Studio Crystal Report Gallery uses Experts to guide creation of reports, forms, labels Creating Crystal Report In order to create and display a simple report Add a Report Designer and design the report template. Add a Crystal Report Viewer control to a form and connect it to the report template. I154-1-A A @ Peter Lo 2010 27 I154-1-A A @ Peter Lo 2010 28

Working with Crystal Reports Using the Report Designer Dataset with data to plot VB.NET Code Chart Expert Wizard Use items in the toolbox to add elements such as lines, boxes, unbound text to the report. Select View/Other Windows/ Document Outline to view The Field Explorer Final Graph Use the Field Explorer window to add new fields to your report. I154-1-A A @ Peter Lo 2010 29 I154-1-A A @ Peter Lo 2010 30 Using the Report Designer The Report Header appears once at the beginning of the report. The Page Header appears at the top of each page. The Group Header appears when you select grouping for your report. The Details section holds data for the report body. The Group Footer displays group subtotals. Using a Dataset for a Report on a Web form Reports based on datasets from Web forms are easily displayed Make sure the project virtual folder s Directory Security is not set for anonymous access Include two lines in authentication section of the Web.config file: <authentication mode="windows" /> <identity impersonate="true" /> The Page Footer displays page numbers at the bottom of each page. The Report Footer shows report totals (if existing). I154-1-A A @ Peter Lo 2010 31 I154-1-A A @ Peter Lo 2010 32

Selecting from Multiple Reports Set up a property To pass a selection to a second form: Set up a property of the form Set up an enum to assist in the selection 'Module-level property declaration Private mintselectedreport As Integer 'SelectedReport property of form WriteOnly Property SelectedReport() As Integer 'Set SelectedReport property using ReportType enum Set(ByVal Value As Integer) mintselectedreport = Value End Set End Property I154-1-A A @ Peter Lo 2010 33 Selecting from Multiple Reports Set up an enum In frmreports, enum values can be used to check the value of the property 'Selection for report type Enum ReportType BooksBySubject BooksByAuthor End Enum 'frmreports If mintselectedreport = ReportType.BooksBySubject Then 'Print the Books by Subject report ElseIf mintselectedreport = ReportType.BooksByAuthor Then 'Print the Books by Author report End If frmmain Private Sub mnufilereportsauthor_click(byval sender As System.Object, _ ByVal e As System.EventArgs) Handles mnufilereportsauthor.click Dim frmreports As New frmreports() frmreports.selectedreport = frmreports.reporttype.booksbyauthor frmreports.show() End Sub I154-1-A A @ Peter Lo 2010 34