CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg,

Slides:



Advertisements
Similar presentations
 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)
Advertisements

Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
5 Chapter 5 Structured Query Language (SQL1) Revision.
CSC 2720 Building Web Applications Database and SQL.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Concepts of Database Management Sixth Edition
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ 1 Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
Microsoft Access 2010 Chapter 7 Using SQL.
MMG508.  Access Types  Tables  Relational tables  Queries  Stored database queries  Forms  GUI forms for data entry/display  Reports  Reports.
Concepts of Database Management, Fifth Edition
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
Concepts of Database Management, Fifth Edition Chapter 4: The Relational Model 3: Advanced Topics.
Chapter 15: Using LINQ to Access Data in C# Programs.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
Database: SQL and MySQL
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
1 Databases November 15, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel, and Goldberg. Published.
Concepts of Database Management Seventh Edition
 2006 Pearson Education, Inc. All rights reserved Database, SQL and ADO.NET.
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
Databases MIS 21. Some database terminology  Database: integrated collection of data  Database Management System (DBMS): environment that provides mechanisms.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
IST 220 Introduction to Databases Course Wrap-up.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved. 2 Revised by Dr. T. Tran for CSI3140.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 22 - SQL, MySQL, DBI and ADO Outline 22.1 Introduction 22.2 Relational Database Model 22.3 Relational.
Lesson 13 Databases Unit 2—Using the Computer. Computer Concepts BASICS - 22 Objectives Define the purpose and function of database software. Identify.
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
CSCI 3328 Object Oriented Programming in C# Chapter 9: Classes and Objects: A Deeper Look – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley.
 2009 Pearson Education, Inc. All rights reserved Databases and LINQ to SQL.
CSCI 3328 Object Oriented Programming in C# Chapter 11: Files and Streams -- Exercises 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg,
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
Database: SQL, MySQL, LINQ and Java DB © by Pearson Education, Inc. All Rights Reserved.
LINQ to DATABASE-2.  Creating the BooksDataContext  The code combines data from the three tables in the Books database and displays the relationships.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
CSCI 4333 Database Design and Implementation – Exercise (1) Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
 A database is an organized collection of data  A database management system (DBMS) provides mechanisms for storing, organizing, retrieving and modifying.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Visual Basic 2010 How to Program
 2012 Pearson Education, Inc. All rights reserved.
LINQ to DATABASE-2.
JDBC.
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
The University of Texas – Pan American
CSCI 3328 Object Oriented Programming in C# Review: Exam II
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises UTPA – Fall 2012 This set of slides is revised from lecture.
Presentation transcript:

CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX

Objectives In this chapter, you will do some exercises about: –The relational database model –LINQ to retrieve and manipulate data from a database –Data binding to display or update data between GUI controls and databases 2

Multiple Choice The international standard database query language is ________. –A. LINQ B. C# C. SQL D. XML A table in a relational database consists of ____ and ____ in which values are stored. –A. rows … columns B. keys … records C. array … collection D. bits and characters The _____uniquely identifies each row in a relational database table. –A. foreign key B. attribute C. primary key D. view The _______control displays data in a table that correspond to rows and columns of the underlying data source. –A. DataSource B. DataContext C. DataBinding D. Database 3

Multiple Choice (cont'd) A relational database can be manipulated in LINQ to SQL via a(n) _________ object, which contains properties for accessing each table in the database. –A. LINQ to SQL B. SQL to LINQ C. SQL to XML D. Database Merging data from multiple relational database tables is called _____ the data. –A. selecting B. projecting C. where D. joining A(n) _________is a column (or groups of column) in a relational database table that matches the primary-key column (groups of column) in another table. –A. foreign key B. attribute C. primary key D. view The _______ property of a control specifies where it gets the data it displays. –A. DataSource B. DataContext C. DataBinding D. Database 4

Multiple Choice (cont'd) The optional _____ clause in a SQL SELECT query specifies selection criteria. –A. WHERE B. SELECT C. FROM D. ORDER BY The optional _____ clause in a SQL SELECT query specifies the order in which rows –A. WHERE B. SELECT C. FROM D. ORDER BY 5

True / False Statements Providing the same value for a foreign key in multiple rows causes the DBMS to report an error. Providing a foreign-key value that does not appear as a primary-key value in another table is an error. The result of a SQL query can be sorted in ascending or descending order. LINQ to SQL automatically saves changes made back to the database. 6

True / False Statements (cont'd) Only SQL UPDATE statement can change the data in a database. SQL SELECT queries can merge data from multiple relational database tables. A SQL DELETE statement deletes only one row in a relational table. 7

Display Table In the example of Books database in this chapter, create an LINQ query that changes the DataSource property of authorBindingSource to contain only the specified authors "Xiang Lian". –private BooksDataContext database = new BooksDataContext(); –authorBindingSource.DataSource = … 8

9

Happy Thanksgiving Day! 10

11