Oregon Institute of Technology



For Chapters 12-16 see Midterm Preparation Chapter 17: An introduction to database programmingThe most common type of relationship between tables in a relational database is a _____________________ relationship.ANS:REF:5352.An inner join combines data from two or more tables in which the related fields _____________.ANS:REF:5433.You can create objects by writing code or by using the _____________ feature.ANS:REF:5574.When you use a data adapter to retrieve data from a database, the data that’s returned is stored in a data table within a ___________________.ANS:REF:5495.A system that divides the processing between the clients and the server is calleda.a server-based systemc.a client/server systemb.an enterprise systemd.a mainframe systemANS:REF:5316.To store the databases of a client/server system, the server requiresa.a database management systemc.a data access APIb.an SQL queryANS:REF:5317.What does a relational database use to uniquely identify each row in a table?a.indexesc.non-primary keysb.foreign keysd.primary keysANS:REF:5338.If a row in one table is related to one or more rows in another table, the tables are said to have aa.one-to-many relationshipc.many-to-many relationshipb.one-to-one relationshipANS:REF:534-535Select VendorName, InvoiceNumber, InvoiceDate, InvoiceTotalFrom Vendors Inner Join Invoices On Vendors.VendorID = Invoices.VendorIDWhere InvoiceTotal >= 500Order By VendorName Desc9.If VendorName contains string data and InvoiceTotal contains decimal values, how will the result set be ordered?a.alphabetically starting with Ac.numerically starting with 0b.alphabetically starting with Zd.numerically starting with 500ANS:REF:54110.What object does use to store a SQL statement?a.data mandb.data adapterd.connectionANS:REF:549 11.What is the primary function of a data adapter?a.To define the connection to a databaseb.To manage the flow of data between a client program and a databasec.To convert data to the format required by an applicationd.To define a SQL operation to be performedANS::REF:54812.Concurrency occurs whena.an update or delete operation is refusedb.two or more users retrieve and then try to update data in the same row of a table at the same timec.an update or delete operation is resubmitted to the databased.a program checks if a row has changed before updating or deleting itANS:REF:551Chapter 18: How to work with data sources and datasets13.When you create a connection to a database, you have the option of saving the connection string to the ________________ file.ANS:REF:56914.In the code that’s generated by Visual Studio when you use a data source, the EndEdit method of the __________________ object is used to save any changes that have been made to the current row to the dataset.ANS:REF:57715.When you use a SQL Server database with a data source, data provider errors throw exceptions of the _______________ class.ANS:REF:58516.To modify a SQL query using a graphical interface, you can use the ____________________.ANS:REF:59317.When you use a data source to get data from a database, you can a.select just one table with all of its columnsb.select one or more tables with all of their columnsc.select just one table and just the columns that you wantd.select one or more tables with just the columns that you want from each tableANS:REF:57118.In the statement that follows, the Fill methodthis.productsTableAdapter.Fill(this.mMABooksDataSet.Products); a.loads the Products table in the dataset with data from the databaseb.loads the Products table in the table adapter with data from the databasec.loads the Products table in the dataset with data from the table adapterd.loads the Products table in the table adapter with data from the datasetANS:REF:57719.When you use a data source, the SQL statements that are used to retrieve and update rows can be found in the SelectCommand and UpdateCommand properties of the a.table adapterb.binding sourcec.data sourced.datasetANS:REF:591Chapter 19: How to work with bound controls and parameterized queries20.For each parameterized query that you add to a data table, Visual Studio adds a/an __________________ control to the form.ANS:ToolStripREF:608-60921.When you add a parameterized query to a table adapter, Visual Studio automatically adds a toolbar to the form that lets youa.navigate from one parameter to the nextb.navigate from one parameter value to the nextc.enter the parameter name and value that’s needed by the queryd.enter the parameter value that’s needed by the queryANS:REF:608-60922.In the statement that follows, the FillByCustomerID methodthis.customersTableAdapter.FillByCustomerID( this.mmaBooksDataSet.Customers, customerID); a.loads the Customers table in the dataset with data from the database in customerID sequenceb.loads the customers table adapter with data from the databasec.loads the Customers table with one row from the databased.loads the customers table adapter with one row from the databaseANS:REF:610-61123.To create a Master/Detail form that uses a DataGridView control for the detail rows, you just need to a.drag a table from the DataSources window to a formb.drag a subordinate table from the Data Sources window to a formc.set the DataSource and DataMember properties for the second table correctlyANS:REF:627Chapter 20: How to use to write your own data access code24.A _________________ lets you include variable information in a SQL statement.ANS:REF:64325.When you execute a command that inserts, updates, or deletes the rows in a dataset, the method that you use returns an integer that represents the number of _______________ that were affected.ANS:REF:64126.Which of the following can not be set in a SQL Server connection string?a.security typec.database mand typed.server nameANS:REF:638-63927.Given a valid connection string named conString, which of the following statements creates a connection for a SQL Server database?a.conString.Open();b.Connection con = new Connection(conString);c.SqlConnection con = new SqlConnection();con.SqlConnectionString = conString;d.SqlConnection con = new SqlConnection(conString);ANS:REF:63927.How is a parameter in a parameterized query for a SQL Server data adapter identified?a.by a question mark (?)b.by an asterisk (*)c.by a named variable that begins with an at sign (@)d.by a named variable that begins with a colon (:)ANS:REF:64328.Which of the following statements adds a parameter named userIDParm to an SQL statement that’s stored in a command object named updateCommand?a.updateCommand.Add(userIDParm);b.updateCommand.Parameter[userIDParm];c.updateCommand.Parameter.Add(userIDParm);d.updateCommand.Parameters.Add(userIDParm);ANS:REF:64727.Given a valid SqlDataReader object named employeeReader, which of the following statements retrieves the first column of the current row and stores it in a string variable named s?a.string s = employeeReader[0];b.string s = (string) employeeReader[0];c.string s = employeeReader[1];d.string s = employeeReader.GetFirstColumn();ANS:REF:649Chapter 21: How to work with files and data streams28.A ____________ allows data to flow from one location (such as a file) to another (such as an application’s internal memory).ANS:REF:68329.The primary difference between a text file and a binary file is that a binary filea.stores data with different data typesb.stores data as fieldsc.separates each record with a new line characterd.uses input and output streamsANS:REF:666-66730.To read a text file, you need to use a FileStream object and aa.TextReader objectc.RecordReader objectb.StreamReader objectd.FieldReader objectANS:REF:682-68336.When you call the Write method of a binary output stream, you must specifya.the character to be writtenc.the record to be writtenb.the data to be writtend.the data type to be writtenANS:REF:69537.What type of exception can be prevented by using the Exists method of the File class?a.IOExceptionc.FileNotFoundExeptionb.EndOfStreamExceptiond.MethodNotFoundExceptionANS:REF:68638.If the path variable contains a string that refers to an existing file, what does the following code do?FileStream fs = new FileStream(path, FileMode.OpenOrCreate);a.Creates the file but doesn’t open itb.Creates the file and then opens itc.Opens the filed.Opens the file and truncates it so its size is zero bytesANS:REF:68539.Assume that you have a valid StreamWriter object named textOut. What does the following code do?textOut.Write("Wizard of Oz");textOut.Write("\t");textOut.WriteLine("1939");a.Writes three strings to a binary fileb.Writes two strings to a binary filec.Writes a record that consists of two tab-delimited fields to a text filed.Throws an IOExceptionANS:REF:68940.What type of file is opened in the window below?a.a text filec.a delimited fileb.a binary filed.a console fileANS:REF:68341.What method of the BinaryReader class do you use to read a decimal value from a binary file?a.Readc.ReadDecimal32b.ReadDecimald.ReadDecimal64ANS:REF:696-697 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download