From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing.

Slides:



Advertisements
Similar presentations
Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Advertisements

Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
 Open the Paradise.exe file  Application displays records in the Books database  Allows the store manager to enter an author’s name (or part of a name)
BIM211 – Visual Programming Database Operations 1.
BIM313 – Advanced Programming Database Operations 1.
Chapter 14.3 LINQ to SQL Programming in Visual Basic 2010: The Very Beginner’s Guide by Jim McKeown Databases – Part 3.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
1 Web-Enabled Decision Support Systems Advance Topics in Database Connectivity Prof. Name Position (123) University Name.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
EGR 141 Computer Problem Solving in Engineering and Computer Science Interfacing with a Database in Visual Basic.NET 2005.
Access Tutorial 10 Automating Tasks with Macros
Some Basic Database Terminology
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
Chapter 15: Using LINQ to Access Data in C# Programs.
Advanced Visual Basic th Edition Chapter 3: Using SQL Server Databases (c) 2007 Pearson Education Inc. All rights reserved. You may modify and copy.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
1 Databound Controls. 2 Objectives You will be able to use design time data binding to display and update SQL Server database data without writing any.
Database Queries. Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be.
Microsoft Access 2010 Building and Using Queries.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Thirteen Working with Access Databases and LINQ.
Key Applications Module Lesson 21 — Access Essentials
Chapter 17 Creating a Database.
A Skills Approach Access 2010 Getting Started with Access 2010 © 2012 The McGraw-Hill Companies, Inc. All rights reserved Chapter 1.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
Part II. Query Types On the design query table pane, right click and the cascading window will appear.
Unit 5, Lesson 2 Editing Records and Using Forms.
1 Database Systems Introduction to Microsoft Access Part 2.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
DataSet Your Database student test score Database Connection Your program needs to establish a connection to the database. Click on “Add New Data Source.”
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
CREATING DATABASE Presenter: Jolanta Soltis. When to use Excel Use Excel when you: –Require a flat or non-relational view of your data (you do not need.
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic nd Edition.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Understand Databound Controls Windows Development Fundamentals LESSON 4.2A.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 350.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Chapter 9 Working with Databases. Copyright © 2011 Pearson Addison-Wesley Introduction In this chapter you will learn: – Basic database concepts – How.
Creating SQL Database file And Displaying a Database Table in a DataGridView.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Common SQL keywords. Building and using CASE Tools Data Base with Microsoft SQL-Server and C#
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Practical Office 2007 Chapter 10
Basic Database Concepts
Brief description on how to navigate within this presentation (ppt)
CIS16 Application Programming with Visual Basic
Database Applications
Unit – V Data Controls.
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing Data Using the Wizard Displaying data

From VS C# 2010 Programming, John Allwork 2 VS2010 C# Programming - DB intro 2 Database – A collection of data. Searchable – user extracts detailed information Relational database – queried and data extracted using SQL language Relation – individual tables linked together. Data held in one place only e.g, employees, customers, orders, suppliers

From VS C# 2010 Programming, John Allwork 3 VS2010 C# Programming - DB intro 3 Microsoft example: Northwind database Employees table Northwind database provided with Access Download from Microsoft

From VS C# 2010 Programming, John Allwork 4 VS2010 C# Programming - DB intro 4 Relational database is composed of linked tables. Table made from records. A record (or row) consists of fields (or columns) of data. Usually one unique record – ID Search using Structured Query Language (SQL) Search – all employees aged about 21, over a certain wage, or called John

From VS C# 2010 Programming, John Allwork 5 VS2010 C# Programming - DB intro 5 Structured Query Language (SQL) SQL search commands: SELECT (field) FROM (table) WHERE (criteria) GROUP BY (criteria) ORDER BY (age) SQL edit commands: INSERT, UPDATE, DELETE

From VS C# 2010 Programming, John Allwork 6 VS2010 C# Programming - DB intro 6 Example SQL commands: SELECT firstName, lastName FROM Employees SELECT firstName, lastName FROM Employees WHERE firstName LIKE ‘J*’ DELETE FROM Employees WHERE firstName = ‘John’ AND lastName = ‘ALLWORK’

From VS C# 2010 Programming, John Allwork 7 VS2010 C# Programming - DB intro 7 ADO.NET – Active database objects Collection of objects to interface to databases Establish a connection between program and database Data held in memory – a DataSet - a collection of DataTable objects Populated using a TableAdapter / Manager Displayed using ‘Data bound’ UI controls Automatically update as user scrolls

From VS C# 2010 Programming, John Allwork 8 VS2010 C# Programming - DB intro 8 Connection:

From VS C# 2010 Programming, John Allwork 9 VS2010 C# Programming - DB intro 9 Database wizard - builds commands for you Declare connection Specify database type and location Open connection Create and fill the Dataset - memory resident copy of the database Access data in DataTable – one table of the Dataset

From VS C# 2010 Programming, John Allwork 10 VS2010 C# Programming - DB intro 10 Main database tasks: 1. View a database 2. Create our own database with linked tables 3. Display database using controls (grid view, details view and navigator) 4. Accessing and displaying data from code 5. Adding data to database with code 1 now, 2-5 in next lectures

From VS C# 2010 Programming, John Allwork 11 VS2010 C# Programming - DB intro 11 Viewing a database New Project > View Server/Database Explorer Add link to existing database (e.g. Northwind) Right-click Data Connections. Add Connection:

From VS C# 2010 Programming, John Allwork 12 VS2010 C# Programming - DB intro 12 Browse for database Test connection

From VS C# 2010 Programming, John Allwork 13 VS2010 C# Programming - DB intro 13 Database added to Solution/Database explorer:

From VS C# 2010 Programming, John Allwork 14 VS2010 C# Programming - DB intro 14 View table data: Display tables on the form. Right-click table:

From VS C# 2010 Programming, John Allwork 15 VS2010 C# Programming - DB intro 15 Employees table: (same as before)

From VS C# 2010 Programming, John Allwork 16 VS2010 C# Programming - DB intro 16 Display from C# program – use wizard: Data > Add New Data Source: Choose database objects Add tables to your database

From VS C# 2010 Programming, John Allwork 17 VS2010 C# Programming - DB intro 17 Use DataGridView control to display table Click table and drag icon to form

From VS C# 2010 Programming, John Allwork 18 VS2010 C# Programming - DB intro 18 Table added to form: DataSet, BindingSource, TableAdaptor/Manager controls also added

From VS C# 2010 Programming, John Allwork 19 VS2010 C# Programming - DB intro 19 GridView display Run program to display

From VS C# 2010 Programming, John Allwork 20 VS2010 C# Programming - DB intro 20 DataGridView tasks: Enable adding, editing, deleting by user Click the arrow (top r.h. corner) to display tasks

From VS C# 2010 Programming, John Allwork 21 VS2010 C# Programming - DB intro 21 Summary – Database - A searchable collection of data. Relational - individual tables linked together Data held in one place only Data extracted using SQL language Wizard builds commands Easy to view an existing database