The University of Texas – Pan American

Slides:



Advertisements
Similar presentations
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ 1 Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
Advertisements

Databases and LINQ Visual Basic 2010 How to Program 1.
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
Chapter 15: Using LINQ to Access Data in C# Programs.
Using Special Operators (LIKE and IN)
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.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
CSCI 4333 Database Design and Implementation – Exercise (5) Xiang Lian The University of Texas – Pan American Edinburg, TX
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
 2009 Pearson Education, Inc. All rights reserved Databases and LINQ to SQL.
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley 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.
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.
CSCI/CMPE 4341 Topic: Programming in Python Chapter 7: Introduction to Object- Oriented Programming in Python – Exercises Xiang Lian The University of.
N5 Databases Notes Information Systems Design & Development: Structures and links.
ORDER BY Clause The result of a query can be sorted in ascending or descending order using the optional ORDER BY clause. The simplest form of.
Database, SQL and ADO.NET
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Visual Basic 2010 How to Program
Relational Database Design
© 2016, Mike Murach & Associates, Inc.
 2012 Pearson Education, Inc. All rights reserved.
Objectives Create an action query to create a table
LINQ to DATABASE-2.
JDBC.
Database Management  .
Databases and Information Management
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
The University of Texas – Pan American
CSCI 3328 Object Oriented Programming in C# Chapter 7: Arrays
The University of Texas – Pan American
CSCI 3327 Visual Basic Chapter 8: Introduction to LINQ and Collections
CIS16 Application Programming with Visual Basic
Chapter 22 - SQL, MySQL, DBI and ADO
CSCI 3328 Object Oriented Programming in C# Review: Exam I
CSCI 3328 Object Oriented Programming in C# Chapter 9: Classes and Objects: A Deeper Look – Exercises UTPA – Fall 2012 This set of slides is revised from.
LINQ to DATABASE-2.
The University of Texas – Pan American
The University of Texas – Pan American
CSCI 3327 Visual Basic Review: Final Exam
The University of Texas – Pan American
The University of Texas Rio Grande Valley
CSCI 3328 Object Oriented Programming in C# Review: Exam II
Access: SQL Participation Project
CSCI 4333 Database Design and Implementation – Exercise (5)
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
The University of Texas – Pan American
CSCI 3328 Object Oriented Programming in C# Chapter 11: Files and Streams -- Exercises UTPA – Fall 2012 This set of slides is revised from lecture slides.
The University of Texas – Pan American
CSCI 6307 Foundation of Systems – Exercise (1)
CSCI 3328 Object Oriented Programming in C# Review: Exam II
Databases and Information Management
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
The University of Texas – Pan American
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
Databases Continued 10/18/05.
The University of Texas – Pan American
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.
Microsoft Access Date.
Tutorial 9 Using Action Queries and Advanced Table Relationships
CSCI 3328 Object Oriented Programming in C# Review: Exam II
CSCI 6307 Foundation of Systems – Exercise (5)
CSCI 4333 Database Design and Implementation – Exercise (1)
Presentation transcript:

The University of Texas – Pan American CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ – Exercises Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu This set of slides is revised from lecture slides of Prof. John Abraham. -- Xiang Lian

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

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

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 Data Context

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 Data Context

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.

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.

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 = …

Happy Thanksgiving Day!