Deck 13: Working With Access Databases and Linq

ملء الشاشة (f)
exit full mode
سؤال
If you do not take deliberate steps in your code to handle exceptions, Visual Basic "handles" them for you.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
A(n) ____ is an electronic file that contains an organized collection of related information.

A) field
B) computer database
C) dataset
D) exception
سؤال
In most tables, one of the fields uniquely identifies each record and is called the ____.

A) exception
B) foreign key
C) primary key
D) cell
سؤال
A ____ is a copy of the data (database fields and records) that can be accessed by an application.

A) position property
B) child table
C) dataset
D) bound control
سؤال
A ____ is a single item of information about a person, place, or thing-such as a name, a salary amount, a Social Security number, or a price.

A) table
B) record
C) dataset
D) field
سؤال
A database file contained in a project is referred to as a logic database file.
سؤال
The field used to link a child table to a parent table is known as the ____ in the child table.

A) record
B) foreign key
C) cell
D) primary key
سؤال
Databases created using Microsoft Access are relational databases.
سؤال
A group of related records is called a ____.

A) table
B) field
C) datagrid
D) primary key
سؤال
Connecting an object to a control is called ____.

A) linking
B) Order By clause
C) LINQ
D) binding
سؤال
A(n) ____ is a group of related fields that contain all of the necessary data about a specific person, place, or thing.

A) object
B) dataset
C) record
D) exception
سؤال
The computer can retrieve data stored in a relational format both quickly and easily, but the data must be displayed in a specific order.
سؤال
When you drag an object from a dataset to an empty area on the form, the computer creates a control and automatically binds the object to it.
سؤال
Each column in a table represents a record and each row represents a field.
سؤال
The controls connected to an object in a dataset are known as ____.

A) bound controls
B) navigator controls
C) tables
D) fields
سؤال
A(n) ____ stores information in tables composed of columns and rows, similar to the format used in a spreadsheet.

A) relational database
B) object
C) bound control
D) dataset
سؤال
A relational database can contain one or more tables.
سؤال
Before an application can access the data stored in a database, you need to connect the application to the database.
سؤال
A BindingNavigator control displays table data in a row and column format, similar to a spreadsheet.
سؤال
When you drag an object from the Data Sources window to an existing control, the computer does not create a new control; rather, it merely binds the object to the existing control.
سؤال
The ____ object provides the connection between the DataSet and the bound controls on the form.

A) TableAdapter
B) DataGridView
C) BindingSource
D) BindingNavigator
سؤال
Which of the following statements selects all of the records in the tblStudents table?

A) Dim records = Select student In tblStudents
B) Dim records = Select student From StudentsDataSet.tblStudents
C) Dim records = From student In StudentsDataSet.tblStudents
Select student
D) Dim records = Select student In StudentsDataSet.tblStudents
From student
سؤال
A label, text box, or button can be added to the BindingNavigator control by accessing the control's task box and clicking ____.

A) AddNewItem
B) Properties
C) Insert Standard Items
D) Edit Items
سؤال
The BindingSource object's ____ methods move the record pointer to the first, last, next, or previous record in the dataset.

A) Position
B) View
C) Move
D) Navigation
سؤال
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   To create a DataGridView control on the form, you would click on the ____ object in the Data Sources window and drag it to the form.</strong> A) CustomerNum B) InvoiceNum C) CustomerDataSet D) tblCustomer <div style=padding-top: 35px> To create a DataGridView control on the form, you would click on the ____ object in the Data Sources window and drag it to the form.

A) CustomerNum
B) InvoiceNum
C) CustomerDataSet
D) tblCustomer
سؤال
If a user is not allowed to add a record, you should deselect the ____ check box within the task list for the DataGridView control.

A) Enable Adding
B) Enable Deleting
C) Edit Items
D) BindingNavigatorAddNewItem
سؤال
The tblItems table contains a numeric field named Price. Which of the following statements finds the lowest price for an item and assigns the result to the dblLowPrice variable?

A) Dim dblLowPrice As Double = Min item In Items.DataSet.tblItems
Select item.Price
B) Dim dblLowPrice As Double = Aggregate item In Items.DataSet.tblItems
Select item.Price Into Min()
C) Dim dblLowPrice As Double = Select Min item In Items.DataSet.tblItems
D) Dim dblLowPrice As Double = Select Aggregate item In Items.DataSet.tblItems
Into Min()
سؤال
The way Visual Basic saves changes to a local database file is determined by the file's ____ property.

A) BindingNavigator
B) Position
C) BindingSource
D) Copy to Output Directory
سؤال
The ____ statement is used for exception handling in a procedure.

A) Try...Catch
B) LINQ
C) Order By
D) aggregate
سؤال
An error that occurs while an application is running is called a(n) ____.

A) logic error
B) runtime error
C) exception
D) message
سؤال
The ____ object can be used to save to the database any changes made to the data contained in the DataSet.

A) TableAdapter
B) TblEmployBindingSource
C) BindingSource
D) DataGridView
سؤال
You can create a query in Visual Basic 2015 using a language feature called ____.

A) ASP
B) SQL
C) Java
D) Language-Integrated Query
سؤال
The ____ property (of the DataGridView) allows you to format a column's data, as well as change the column's width and alignment.

A) AutoSizeColumnsMode
B) DefaultCellStyle
C) BindingNavigator
D) DataGridView
سؤال
The ____ object is responsible for retrieving the appropriate information from the database and storing it in the DataSet.

A) TableAdapter
B) TblEmployBindingSource
C) BindingSource
D) DataGridView
سؤال
You can use a(n) ____ to specify both the records to select in a dataset and the order in which to arrange the records.

A) condition
B) parameter
C) query
D) aggregate operator
سؤال
The ____ clause of LINQ is used to arrange the records in either ascending (the default) or descending order by one or more fields.

A) Order By
B) condition
C) query
D) Where
سؤال
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   You are responsible for connecting the Access database that contains the tblCustomer table to an application. You must first use the Data Source Configuration Wizard to ____.</strong> A) test to see if the database is connected to the application B) add a new data source C) preview the contents of the dataset D) bind the controls to the dataset <div style=padding-top: 35px> You are responsible for connecting the Access database that contains the tblCustomer table to an application. You must first use the Data Source Configuration Wizard to ____.

A) test to see if the database is connected to the application
B) add a new data source
C) preview the contents of the dataset
D) bind the controls to the dataset
سؤال
The BindingSource object stores the position of the record pointer in its ____ property.

A) View
B) Position
C) Navigation
D) Cell
سؤال
When an application is running, you can use the ____ control to move from one record to the next in the dataset, as well as to add or delete a record and save any changes made to the dataset.

A) DataSet
B) BindingNavigator
C) TableAdapter
D) BindingSource
سؤال
The intersection of a row and a column in a DataGridView control is called a ____.

A) cell
B) table
C) record
D) key
سؤال
What are the advantages to storing data in a relational database?
سؤال
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select all records.
سؤال
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write the statement needed to assign the contents of the records variable to the BindingSource object for the tblBicycle table. Explain why this should be done in an application.
سؤال
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write the code to calculate the average price of all of the bicycles in inventory.
سؤال
Write the code needed to include a Try...Catch statement that will handle an error that might occur while saving in an application. Use the following statements in the Try block, along with a message for the user of the Student Data Application that notifies the user the changes have been saved. Provide an error message if an exception occurs.
Me.Validate()
Me.TblStudentBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.StudentsDataSet)
سؤال
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   You need to make sure the user of the application can add records but cannot delete any records. Which of the following needs to be performed?</strong> A) Remove the Add new button from the TblCustomerBindingNavigator control. B) Remove the Delete button from the TblCustomerBindingNavigator control. C) Remove the Save button from the TblCustomerBindingNavigator control. D) b and c <div style=padding-top: 35px> You need to make sure the user of the application can add records but cannot delete any records. Which of the following needs to be performed?

A) Remove the Add new button from the TblCustomerBindingNavigator control.
B) Remove the Delete button from the TblCustomerBindingNavigator control.
C) Remove the Save button from the TblCustomerBindingNavigator control.
D) b and c
سؤال
Write the statements to move the record pointer to the first and last records in the dataset for the Customer table.
سؤال
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select the records in descending order by the Quantity field.
سؤال
What is the DataGridView control and how is it used?
سؤال
Write the statements to move the record pointer to the previous and next records in the dataset for the Vehicle table.
سؤال
Problems - Correcting Logic and Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
Private Sub TblItemsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TblItemsBindingNavigatorSaveItem.Click
Try
Validate()
Me.TblItemsBindingSource
Me.TableAdapterManager.UpdateAll(Me.ItemsDataSet)
MessageBox.Show("Changes saved", "Books Galore",
MessageBoxButtons.OK,
MessageBoxIcon.Information)
Catch ex
MessageBox.Show(ex.Message, "Books Galore",
MessageBoxButtons.OK,
MessageBoxIcon.Information)
End
End Sub
سؤال
Relational databases contain multiple tables that relate to each other in some way. How are primary and foreign keys used in such a database?
سؤال
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   Which of the following statements will select all invoices of $200.00 or more and arrange the invoices in ascending order by Customer number?</strong> A) Dim records = From customer In CustomerDataSet.tblCustomer Where customer.InvoiceAmt > 200 Order By invoice.CustomerNum Select customer B) Dim records = From customer In CustomerDataSet.tblCustomer Where customer.InvoiceAmt > 200 Order invoice.CustomerNum Ascending Select customer C) Dim records = From CustomerDataSet.tblCustomer Where customer.InvoiceAmt > 200 Order invoice.CustomerNum Select customer D) Dim records = From customer In CustomerDataSet.tblCustomer Where customer.InvoiceAmt Order By invoice.CustomerNum Select customer <div style=padding-top: 35px> Which of the following statements will select all invoices of $200.00 or more and arrange the invoices in ascending order by Customer number?

A) Dim records = From customer In CustomerDataSet.tblCustomer
Where customer.InvoiceAmt > 200
Order By invoice.CustomerNum
Select customer
B) Dim records = From customer In CustomerDataSet.tblCustomer
Where customer.InvoiceAmt > 200
Order invoice.CustomerNum Ascending
Select customer
C) Dim records = From CustomerDataSet.tblCustomer
Where customer.InvoiceAmt > 200
Order invoice.CustomerNum
Select customer
D) Dim records = From customer In CustomerDataSet.tblCustomer
Where customer.InvoiceAmt
Order By invoice.CustomerNum
Select customer
سؤال
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select all bicycles with a price greater than $450. Arrange the bicycles in descending order by price.
سؤال
List the five objects that are placed in the component tray when a table object is bound to a DataGridView control.
سؤال
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   Which of the following statements will calculate a total for all of the unpaid invoices?</strong> A) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Select customer.InvoicePaid Into Sum() B) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Select customer.InvoiceAmt Into Sum() C) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Where customer.InvoicePaid.ToUpper = N Select customer.InvoiceAmt Into Average() D) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Where customer.InvoicePaid.ToUpper = N Select customer.InvoiceAmt Into Sum() <div style=padding-top: 35px> Which of the following statements will calculate a total for all of the unpaid invoices?

A) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Select customer.InvoicePaid Into Sum()
B) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Select customer.InvoiceAmt Into Sum()
C) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Where customer.InvoicePaid.ToUpper = "N"
Select customer.InvoiceAmt Into Average()
D) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Where customer.InvoicePaid.ToUpper = "N"
Select customer.InvoiceAmt Into Sum()
سؤال
Define the terms "record," "field," and "table." Provide examples of each term when you are defining them.
سؤال
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to calculate the total value of the inventory.
سؤال
Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click
' moves to the next record
TblClientBindingSource.MovePrevious()
End Sub
Private Sub btnPrevious_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
' moves to the previous record
TblClientBindingSource.MoveNext()
End Sub
Private Sub btnDisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
' displays all clients or
' specific clients for a certain state
Const strPROMPT As String = "Enter one or more " &
"letters. Leave blank to retrieve all records."
Dim strSearch As String
' get user input
strSearch = InputBox(strPROMPT, "Find State").ToUpper
' select the appropriate records
Dim records = ClientDataSet.tblClient
For client.State.ToUpper Like strSearch & "*"
Select
' display the records
TblClientBindingSource.DataSource = records
End Sub
سؤال
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select all blue bicycles. Order the bicycles in ascending order by quantity.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/60
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 13: Working With Access Databases and Linq
1
If you do not take deliberate steps in your code to handle exceptions, Visual Basic "handles" them for you.
True
2
A(n) ____ is an electronic file that contains an organized collection of related information.

A) field
B) computer database
C) dataset
D) exception
B
3
In most tables, one of the fields uniquely identifies each record and is called the ____.

A) exception
B) foreign key
C) primary key
D) cell
C
4
A ____ is a copy of the data (database fields and records) that can be accessed by an application.

A) position property
B) child table
C) dataset
D) bound control
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
5
A ____ is a single item of information about a person, place, or thing-such as a name, a salary amount, a Social Security number, or a price.

A) table
B) record
C) dataset
D) field
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
6
A database file contained in a project is referred to as a logic database file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
7
The field used to link a child table to a parent table is known as the ____ in the child table.

A) record
B) foreign key
C) cell
D) primary key
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
8
Databases created using Microsoft Access are relational databases.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
9
A group of related records is called a ____.

A) table
B) field
C) datagrid
D) primary key
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
10
Connecting an object to a control is called ____.

A) linking
B) Order By clause
C) LINQ
D) binding
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
11
A(n) ____ is a group of related fields that contain all of the necessary data about a specific person, place, or thing.

A) object
B) dataset
C) record
D) exception
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
12
The computer can retrieve data stored in a relational format both quickly and easily, but the data must be displayed in a specific order.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
13
When you drag an object from a dataset to an empty area on the form, the computer creates a control and automatically binds the object to it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
14
Each column in a table represents a record and each row represents a field.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
15
The controls connected to an object in a dataset are known as ____.

A) bound controls
B) navigator controls
C) tables
D) fields
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
16
A(n) ____ stores information in tables composed of columns and rows, similar to the format used in a spreadsheet.

A) relational database
B) object
C) bound control
D) dataset
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
17
A relational database can contain one or more tables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
18
Before an application can access the data stored in a database, you need to connect the application to the database.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
19
A BindingNavigator control displays table data in a row and column format, similar to a spreadsheet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
20
When you drag an object from the Data Sources window to an existing control, the computer does not create a new control; rather, it merely binds the object to the existing control.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
21
The ____ object provides the connection between the DataSet and the bound controls on the form.

A) TableAdapter
B) DataGridView
C) BindingSource
D) BindingNavigator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which of the following statements selects all of the records in the tblStudents table?

A) Dim records = Select student In tblStudents
B) Dim records = Select student From StudentsDataSet.tblStudents
C) Dim records = From student In StudentsDataSet.tblStudents
Select student
D) Dim records = Select student In StudentsDataSet.tblStudents
From student
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
23
A label, text box, or button can be added to the BindingNavigator control by accessing the control's task box and clicking ____.

A) AddNewItem
B) Properties
C) Insert Standard Items
D) Edit Items
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
24
The BindingSource object's ____ methods move the record pointer to the first, last, next, or previous record in the dataset.

A) Position
B) View
C) Move
D) Navigation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
25
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   To create a DataGridView control on the form, you would click on the ____ object in the Data Sources window and drag it to the form.</strong> A) CustomerNum B) InvoiceNum C) CustomerDataSet D) tblCustomer To create a DataGridView control on the form, you would click on the ____ object in the Data Sources window and drag it to the form.

A) CustomerNum
B) InvoiceNum
C) CustomerDataSet
D) tblCustomer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
26
If a user is not allowed to add a record, you should deselect the ____ check box within the task list for the DataGridView control.

A) Enable Adding
B) Enable Deleting
C) Edit Items
D) BindingNavigatorAddNewItem
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
27
The tblItems table contains a numeric field named Price. Which of the following statements finds the lowest price for an item and assigns the result to the dblLowPrice variable?

A) Dim dblLowPrice As Double = Min item In Items.DataSet.tblItems
Select item.Price
B) Dim dblLowPrice As Double = Aggregate item In Items.DataSet.tblItems
Select item.Price Into Min()
C) Dim dblLowPrice As Double = Select Min item In Items.DataSet.tblItems
D) Dim dblLowPrice As Double = Select Aggregate item In Items.DataSet.tblItems
Into Min()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
28
The way Visual Basic saves changes to a local database file is determined by the file's ____ property.

A) BindingNavigator
B) Position
C) BindingSource
D) Copy to Output Directory
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
29
The ____ statement is used for exception handling in a procedure.

A) Try...Catch
B) LINQ
C) Order By
D) aggregate
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
30
An error that occurs while an application is running is called a(n) ____.

A) logic error
B) runtime error
C) exception
D) message
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
31
The ____ object can be used to save to the database any changes made to the data contained in the DataSet.

A) TableAdapter
B) TblEmployBindingSource
C) BindingSource
D) DataGridView
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
32
You can create a query in Visual Basic 2015 using a language feature called ____.

A) ASP
B) SQL
C) Java
D) Language-Integrated Query
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
33
The ____ property (of the DataGridView) allows you to format a column's data, as well as change the column's width and alignment.

A) AutoSizeColumnsMode
B) DefaultCellStyle
C) BindingNavigator
D) DataGridView
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
34
The ____ object is responsible for retrieving the appropriate information from the database and storing it in the DataSet.

A) TableAdapter
B) TblEmployBindingSource
C) BindingSource
D) DataGridView
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
35
You can use a(n) ____ to specify both the records to select in a dataset and the order in which to arrange the records.

A) condition
B) parameter
C) query
D) aggregate operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
36
The ____ clause of LINQ is used to arrange the records in either ascending (the default) or descending order by one or more fields.

A) Order By
B) condition
C) query
D) Where
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
37
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   You are responsible for connecting the Access database that contains the tblCustomer table to an application. You must first use the Data Source Configuration Wizard to ____.</strong> A) test to see if the database is connected to the application B) add a new data source C) preview the contents of the dataset D) bind the controls to the dataset You are responsible for connecting the Access database that contains the tblCustomer table to an application. You must first use the Data Source Configuration Wizard to ____.

A) test to see if the database is connected to the application
B) add a new data source
C) preview the contents of the dataset
D) bind the controls to the dataset
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
38
The BindingSource object stores the position of the record pointer in its ____ property.

A) View
B) Position
C) Navigation
D) Cell
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
39
When an application is running, you can use the ____ control to move from one record to the next in the dataset, as well as to add or delete a record and save any changes made to the dataset.

A) DataSet
B) BindingNavigator
C) TableAdapter
D) BindingSource
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
40
The intersection of a row and a column in a DataGridView control is called a ____.

A) cell
B) table
C) record
D) key
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
41
What are the advantages to storing data in a relational database?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
42
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select all records.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
43
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write the statement needed to assign the contents of the records variable to the BindingSource object for the tblBicycle table. Explain why this should be done in an application.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
44
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write the code to calculate the average price of all of the bicycles in inventory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
45
Write the code needed to include a Try...Catch statement that will handle an error that might occur while saving in an application. Use the following statements in the Try block, along with a message for the user of the Student Data Application that notifies the user the changes have been saved. Provide an error message if an exception occurs.
Me.Validate()
Me.TblStudentBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.StudentsDataSet)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
46
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   You need to make sure the user of the application can add records but cannot delete any records. Which of the following needs to be performed?</strong> A) Remove the Add new button from the TblCustomerBindingNavigator control. B) Remove the Delete button from the TblCustomerBindingNavigator control. C) Remove the Save button from the TblCustomerBindingNavigator control. D) b and c You need to make sure the user of the application can add records but cannot delete any records. Which of the following needs to be performed?

A) Remove the Add new button from the TblCustomerBindingNavigator control.
B) Remove the Delete button from the TblCustomerBindingNavigator control.
C) Remove the Save button from the TblCustomerBindingNavigator control.
D) b and c
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
47
Write the statements to move the record pointer to the first and last records in the dataset for the Customer table.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
48
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select the records in descending order by the Quantity field.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
49
What is the DataGridView control and how is it used?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
50
Write the statements to move the record pointer to the previous and next records in the dataset for the Vehicle table.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
51
Problems - Correcting Logic and Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
Private Sub TblItemsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TblItemsBindingNavigatorSaveItem.Click
Try
Validate()
Me.TblItemsBindingSource
Me.TableAdapterManager.UpdateAll(Me.ItemsDataSet)
MessageBox.Show("Changes saved", "Books Galore",
MessageBoxButtons.OK,
MessageBoxIcon.Information)
Catch ex
MessageBox.Show(ex.Message, "Books Galore",
MessageBoxButtons.OK,
MessageBoxIcon.Information)
End
End Sub
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
52
Relational databases contain multiple tables that relate to each other in some way. How are primary and foreign keys used in such a database?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
53
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   Which of the following statements will select all invoices of $200.00 or more and arrange the invoices in ascending order by Customer number?</strong> A) Dim records = From customer In CustomerDataSet.tblCustomer Where customer.InvoiceAmt > 200 Order By invoice.CustomerNum Select customer B) Dim records = From customer In CustomerDataSet.tblCustomer Where customer.InvoiceAmt > 200 Order invoice.CustomerNum Ascending Select customer C) Dim records = From CustomerDataSet.tblCustomer Where customer.InvoiceAmt > 200 Order invoice.CustomerNum Select customer D) Dim records = From customer In CustomerDataSet.tblCustomer Where customer.InvoiceAmt Order By invoice.CustomerNum Select customer Which of the following statements will select all invoices of $200.00 or more and arrange the invoices in ascending order by Customer number?

A) Dim records = From customer In CustomerDataSet.tblCustomer
Where customer.InvoiceAmt > 200
Order By invoice.CustomerNum
Select customer
B) Dim records = From customer In CustomerDataSet.tblCustomer
Where customer.InvoiceAmt > 200
Order invoice.CustomerNum Ascending
Select customer
C) Dim records = From CustomerDataSet.tblCustomer
Where customer.InvoiceAmt > 200
Order invoice.CustomerNum
Select customer
D) Dim records = From customer In CustomerDataSet.tblCustomer
Where customer.InvoiceAmt
Order By invoice.CustomerNum
Select customer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
54
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select all bicycles with a price greater than $450. Arrange the bicycles in descending order by price.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
55
List the five objects that are placed in the component tray when a table object is bound to a DataGridView control.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
56
Case-Based Critical Thinking Questions Case 1 - MaidToOrder
The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.
<strong>Case-Based Critical Thinking Questions Case 1 - MaidToOrder The database for a cleaning service company contains the following table, named tblCustomer, that includes customer invoice data. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers.   Which of the following statements will calculate a total for all of the unpaid invoices?</strong> A) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Select customer.InvoicePaid Into Sum() B) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Select customer.InvoiceAmt Into Sum() C) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Where customer.InvoicePaid.ToUpper = N Select customer.InvoiceAmt Into Average() D) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer Where customer.InvoicePaid.ToUpper = N Select customer.InvoiceAmt Into Sum() Which of the following statements will calculate a total for all of the unpaid invoices?

A) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Select customer.InvoicePaid Into Sum()
B) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Select customer.InvoiceAmt Into Sum()
C) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Where customer.InvoicePaid.ToUpper = "N"
Select customer.InvoiceAmt Into Average()
D) Dim decTotalUnpaid = Aggregate customer In CustomerDataSet.tblCustomer
Where customer.InvoicePaid.ToUpper = "N"
Select customer.InvoiceAmt Into Sum()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
57
Define the terms "record," "field," and "table." Provide examples of each term when you are defining them.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
58
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to calculate the total value of the inventory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
59
Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click
' moves to the next record
TblClientBindingSource.MovePrevious()
End Sub
Private Sub btnPrevious_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
' moves to the previous record
TblClientBindingSource.MoveNext()
End Sub
Private Sub btnDisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
' displays all clients or
' specific clients for a certain state
Const strPROMPT As String = "Enter one or more " &
"letters. Leave blank to retrieve all records."
Dim strSearch As String
' get user input
strSearch = InputBox(strPROMPT, "Find State").ToUpper
' select the appropriate records
Dim records = ClientDataSet.tblClient
For client.State.ToUpper Like strSearch & "*"
Select
' display the records
TblClientBindingSource.DataSource = records
End Sub
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
60
Writing LINQ Statements
The tblBicycle table contains five fields: ItemNum, ItemName, Color, Price, and Quantity. The Price and Quantity fields are numeric; all other fields are text. The dataset name is BicycleDataSet.
Write a LINQ statement to select all blue bicycles. Order the bicycles in ascending order by quantity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 60 في هذه المجموعة.