QUIZ HELP for C# QUESTION 1 To invoke File’s Copy( ) method to make a copy of “s
ID: 3810220 • Letter: Q
Question
QUIZ HELP for C#
QUESTION 1
To invoke File’s Copy( ) method to make a copy of “source.txt”, naming the new file “target.txt”, you would write: File.Copy("source.txt", "target.txt"); because Copy is a static member of the File class.
True
False
QUESTION 2
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
What does the above statement do?
Reads every line from an input file.
Checks to see if the file is null.
Retrieves one line of text from an input file.
Retrieves a single character from an input file.
QUESTION 3
When you place an @ in front of a string, the string becomes a(n) ____.
numeric value
comment
argument
verbatim string
QUESTION 4
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
If you browse using Windows Explorer or Computer, the physical file that already exists before the two statements from above are executed is ____.
outputFile
someOutputFile
inputFile
someInputFile
QUESTION 5
When writing text files, if you add true to the constructor for the Append argument, ____.
a backup is made of the old file
lines are added onto the end of the file
“file already exists” message is displayed if a file by the same name exists
new data is added onto the end of each line in the file
QUESTION 6
No exception is thrown if you attempt to close or open a file that does not exist.
True
False
If an invalid path is listed in the constructor for the StreamWriter object, you will be prompted to reenter the file name.
True
False
QUESTION 8
In order to invoke the Copy( ) method of the File class, instantiate an object of the File class and send as an argument a filename.
True
False
QUESTION 9
To programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exceptions thrown in an application, you should send the filename as an argument to Exists( ) before attempting to construct an object.
True
False
QUESTION 10
If a StreamReader object named reader is instantiated and associated with a file stored in the project directory named “test.dta”, which of the following statements would check to see if the “test.dta” exists?
if (reader.Exists(“test.dta”))
if (File.Exists(“test.dta”))
if (File.Exists(reader))
if (reader.Exists( ))
QUESTION 11
A Data Source Configuration Wizard is available in Visual Studio to automatically generate the connection string, create dataset and table adapter objects, and bring the data into an application.
True
False
QUESTION 12
You may not want to make a local copy of the database if ____.
you are not the database administrator
this is the first time the database is accessed
updates or changes are being made to the database
it is a SQL Server database
QUESTION 13
The OleDbCommand class is used to hold the SQL statements used to access an Oracle database.
True
False
QUESTION 14
One of the visual tools that provides a graphical representation of the dataset object and enables you to set relationships between tables is the ____.
Data Sources Wizard
Configuration Designer
Data Designer
DataSet Designer
QUESTION 15
After connecting to the database, one way to retrieve records programmatically from the database is to ____
issue an SQL query.
connect to a CommandBuilder object.
use a DataAdapter object.
use a DataReader object.
QUESTION 16
A foreign key is a column (field) or combination of columns that uniquely identifies a row in a table.
True
False
QUESTION 17
The ADO.NET architecture encapsulates the details of differing database structures such as
Oracle, as opposed to Access, in the form of ____.
data adapters
data tables
databases
data providers
QUESTION 18
When accessing data from a database, select the records (and fields) from the database by executing a SQL Fill statement.
True
False
1 points
QUESTION 19
The DataGridView is a customizable control that can be bound to a data source.
True
False
QUESTION 20
The Data Source Configuration Wizard simplifies connecting your application to a data source by guiding you through the process, automatically generating the connection string, creating dataset and table adapter objects, and bringing the data into your application.
True
False
a.Reads every line from an input file.
b.Checks to see if the file is null.
c.Retrieves one line of text from an input file.
d.Retrieves a single character from an input file.
Explanation / Answer
3) verbatim string
7) False
8) False
9) True
12) you are not the database administrator
14) DataSet Designer
17) data providers