• Home
  • Textbooks
  • C# Programming: From Problem Analysis to Program Design
  • Database Access using ADO.NET

C# Programming: From Problem Analysis to Program Design

Barbara Doyle

Chapter 13

Database Access using ADO.NET - all with Video Answers

Educators


Chapter Questions

01:02

Problem 1

An in-memory representation of multiple rows and columns of data from the database
is stored in what type of object?
a. data provider
b. data reader
c. datagrid
d. dataset
e. data adapter

Aditya Sood
Aditya Sood
Numerade Educator
00:48

Problem 2

All of the following are examples of ADO.NET data providers except:
a. OLE DB
b. Oracle
c. ODBC
d. Sql Server
e. Access

Aditya Sood
Aditya Sood
Numerade Educator
00:49

Problem 3

Which of the following is the class name of a gridlike structure used to display data
from a database?
a. ComboBox
b. ListBox
c. DataGridView
d. Grid
e. GridData

Aditya Sood
Aditya Sood
Numerade Educator
00:49

Problem 4

Which of the following is the class name of a gridlike structure used to display data
from a database?
a. ComboBox
b. ListBox
c. DataGridView
d. Grid
e. GridData

Aditya Sood
Aditya Sood
Numerade Educator
00:58

Problem 5

The core classes available with each data provider include all of the following except:
a. connection
b. data adapter
c. command
d. dataset
e. data reader

Aditya Sood
Aditya Sood
Numerade Educator
00:58

Problem 6

Each data provider class is grouped and accessible through its:
a. namespace
b. database
c. datagrid
d. provider
e. system

Aditya Sood
Aditya Sood
Numerade Educator
00:50

Problem 7

Which of the following is a valid SQL statement that retrieves all four columns from
the customer table?
a. SELECT ALL FROM customer
b. SELECT * FROM customer
c. SELECT customer
d. SELECT , , , , FROM customer
e. SELECT @ @ @ @ FROM customer

Aditya Sood
Aditya Sood
Numerade Educator
00:59

Problem 8

Parameters for SQL Server SQL statements are written slightly different from those
written for an Access database.With SQL Server, a parameter is indicated using:
a. @ followed by an identifier
b. @ without an identifier
c. ? followed by an identifier
d. @ without an identifier
e. a params keyword

Aditya Sood
Aditya Sood
Numerade Educator
00:59

Problem 9

The SQL clause that can be added to a SELECT statement to retrieve data from
multiple tables is:
a. BETWEEN
b. INNER JOIN
c. CROSS CONNECTION
d. WHERE
e. UPDATE

Aditya Sood
Aditya Sood
Numerade Educator
00:53

Problem 10

The following namespaces (System.Data.OleDB, System.Data.SqlClient,
System.Data.Odbc, System.Data.OracleClient) include classes for different:
a. data providers
b. file streams
c. ADO.NET applications
d. databases
e. data readers

Aditya Sood
Aditya Sood
Numerade Educator
00:54

Problem 11

For read-only access to databases, which ADO.NET class is used?
a. dataset
b. data adapter
c. command builder
d. connection
e. data reader

Aditya Sood
Aditya Sood
Numerade Educator
01:00

Problem 12

To provide access to an Access Jet database management system, which data provider
is used?
a. System.Data.OleDb
b. System.Data.SqlClient
c. System.Data.Odbc
d. System.Data.OracleClient
e. Microsoft.Jet.OLEDB.4.0

Aditya Sood
Aditya Sood
Numerade Educator
00:50

Problem 13

Which class is used with the dataset class to facilitate using a disconnected database?
a. DataAdapter
b. DataReader
c. Command
d. OleDbConnection
e. Fill

Aditya Sood
Aditya Sood
Numerade Educator
00:50

Problem 14

To avoid writing additional SQL statements to update a live database, you instantiate an
object of which class?
a. DataAdapter
b. DataReader
c. DataSet
d. CommandBuilder
e. DataGrid

Aditya Sood
Aditya Sood
Numerade Educator
01:52

Problem 15

To release the database so that it can be used by other applications, which method
should be invoked?
a. ReleaseDb( )
b. Release( )
c. StopAccess( )
d. Close( )
e. none of the above

Foster Wisusik
Foster Wisusik
Numerade Educator
00:50

Problem 16

To retrieve specific records from a database, you could create a new query and have it stored as a method using an object of the _______ class.
a. Dataset
b. DataProvider
c. TableAdapter
d. Connection
e. Command

Aditya Sood
Aditya Sood
Numerade Educator
00:42

Problem 17

Which method is used to originally populate a data-bound control?
a. Dataset Fill( ) method
b. Dataset Update( ) method
c. TableAdapter Fill( ) method
d. BindingNavigator Save( ) method
e. PageLoad( ) event-handler method

Aditya Sood
Aditya Sood
Numerade Educator
00:50

Problem 18

In Visual Studio, the tool that enables you to connect to a database and automatically populate a dataset object using a TableAdapter object is the ________ wizard:
a. Data Source Configuration
b. Data Source
c. Query Builder
d. DataSet Designer
e. TableAdapter Query Configuration

Aditya Sood
Aditya Sood
Numerade Educator
00:50

Problem 19

Which window is used in Visual Studio to display dataset tables so they can be dragged
and dropped onto the form?
a. Server Explorer
b. Properties
c. DataSet Designer
d. Data Sources
e. Solution Explorer

Aditya Sood
Aditya Sood
Numerade Educator
01:02

Problem 20

A connection string contains:
a. a using directive
b. the name of the data source
c. the version number of database management system
d. the list of fields in the database
e. a SQL statement

Aditya Sood
Aditya Sood
Numerade Educator
01:02

Problem 21

Explain how the dataset,table adapter,and a data grid object are used to update a database.

Aditya Sood
Aditya Sood
Numerade Educator
02:23

Problem 22

Write SQL statements for the following:
a. Retrieve all partNumber and partDescription columns from a Parts table that has
15 different columns.
b. Retrieve records from a Parts table for partNumbers 1000 through 2000. Display the
partDescription only.
c. Insert a new record into a Customer table. Store the following values in the
columns: LName=Osprey, FName=Teola, CNumber=23456.The columns are
ordered as follows: CNumber, LName, FName.

Adriano Chikande
Adriano Chikande
Numerade Educator
00:31

Problem 23

What happens when you drag a dataset table from the Data Sources window onto a blank form?

Aditya Sood
Aditya Sood
Numerade Educator
00:42

Problem 24

How can you have controls (other than the default Data Sources window controls) display data from a database table?

Aditya Sood
Aditya Sood
Numerade Educator
01:05

Problem 25

How does a table adapter differ from a data adapter?

Aditya Sood
Aditya Sood
Numerade Educator