Question 1 of 20 0.0 5.0 Points Permistic concurency means A. ...... control works on the assumption that resource conflicts between multiple users are unlikely (but not impossible), and allows transactions to execute without locking any resources. Only when attempting to change data are resources checked to determine if any conflicts have occurred. If a conflict occurs, the application must read the data and attempt the change again. B. ….whatever data modification was made last gets written to the database. C. …. control locks resources as they are required, for the duration of a transaction. Unless deadlocks occur, a transaction is assured of successful completion. Question 2 of 20 5.0 5.0 Points What is the sequential procedure in working with databases? A. Connection object, connection string, close connection object, close connection string B. Connection string, connection object, close connection string, close connection object C. Connection object, connection string, close connection string, close connection object
Trang 3string sqlConnectString = ""Data Source=(local);"" +
""Integrated security=SSPI;Initial Catalog=AdventureWorks;"";
string sqlSelect = ""SELECT TOP 3 * FROM Sales.SalesOrderHeader;"" +
""SELECT TOP 3 * FROM Sales.SalesOrderDetail"";
int rsNumber;
SqlDataAdapter da = new SqlDataAdapter(sqlSelect, sqlConnectString);
DataSet ds = new DataSet( );
da.Fill(ds);
rsNumber = 0;
foreach (DataTable dt in ds.Tables)
{
Console.WriteLine(""Result set: {0}"", ++rsNumber);
foreach (DataRow row in dt.Rows)
Trang 4A Run time error, multi result set is not supported by ADO.NET
B Nothing wong, multi result set is supported by ADO.NET
Permistic concurency means
A control works on the assumption that resource conflicts between multiple users are
unlikely (but not impossible), and allows transactions to execute without locking any resources Only when attempting to change data are resources checked to determine if any conflicts have occurred If a conflict occurs, the application must read the data and attempt the change again
B ….whatever data modification was made last gets written to the database
C … control locks resources as they are required, for the duration of a transaction Unless
deadlocks occur, a transaction is assured of successful completion
When we need to retrieve only a single value from the Database,which Method is efficient
A ExecuteReader()
Trang 5B ExecuteXmlReader()
C ExecuteNonQuery()
D ExecuteScalar()
Optimistic concurency means
A … control locks resources as they are required, for the duration of a transaction Unless
deadlocks occur, a transaction is assured of successful completion
B ….whatever data modification was made last gets written to the database
C control works on the assumption that resource conflicts between multiple users are
unlikely (but not impossible), and allows transactions to execute without locking any resources Only when attempting to change data are resources checked to determine if any conflicts have occurred If a conflict occurs, the application must read the data and attempt the change again
If the DSN (Data Source Name) has to be used with SQL Server, which namespace has to be imported ?
Trang 6Database connectivity with ADO has 3 main objects:
A All of the above
B ADODB.Recordset
C ADODB.Command
D ADODB.Connection
Trang 7Question 11 of 20 5.0/ 5.0 PointsWhich of the following Namespace is used for better performance when connecting to SQLServer ?
Trang 8C GetUpdated()
D FindChanges()
Which of the following statements is true about Dataset ?
A Dataset can store only one table in its cache
B Dataset cannot store any tables in the cache
C Dataset can store multiple tables in cache
D Dataset stores tables in the cache,only when cache set to true
How do the SQL classes in Net Communicate to SQLServer ?
A TDS - Tabular Data Stream
Trang 9B OLEDB
C ODBC
D None of the above
What is a connection string?
A Specifies the type of ODBC driver to use, database format and filename
B Specifies whether to use a DSN or DSN-less connection
C Opens the initial connection to a database
D Specifies which type of database is being used
DataSet object contains :
Trang 11want to ensure that no user can perform any updates in the database until your transaction is complete What IsolationLevel should you use?
Trang 12D DataSet
You decide to use named parameters in a SqlCommand object in order to execute SQL queries on a database You have a parameter named “CustomerName” How do you refer to it within the SQL query text in the SqlCommand object?
Trang 13A control works on the assumption that resource conflicts between multiple users are
unlikely (but not impossible), and allows transactions to execute without locking any resources Only when attempting to change data are resources checked to determine if any conflicts have occurred If a conflict occurs, the application must read the data and attempt the change again
B ….whatever data modification was made last gets written to the database
C … control locks resources as they are required, for the duration of a transaction Unless
deadlocks occur, a transaction is assured of successful completion
What is the sequential procedure in working with databases?
A Connection object, connection string, close connection object, close connection string
B Connection string, connection object, close connection string, close connection object
C Connection object, connection string, close connection string, close connection object
Which method of DataTable can be used to return all changed rows since it was last loaded?
Trang 15Question 5 of 20 5.0/ 5.0 Points
You have code that executes SQL statements on a database within the context of a SQLTransaction You want to ensure that no user can perform any updates in the database until your transaction is complete What IsolationLevel should you use?
Trang 20string sqlConnectString = ""Data Source=(local);"" +
""Integrated security=SSPI;Initial Catalog=AdventureWorks;"";
string sqlSelect = ""SELECT TOP 3 * FROM Sales.SalesOrderHeader;"" +
""SELECT TOP 3 * FROM Sales.SalesOrderDetail"";
int rsNumber;
SqlDataAdapter da = new SqlDataAdapter(sqlSelect, sqlConnectString);
DataSet ds = new DataSet( );
da.Fill(ds);
rsNumber = 0;
foreach (DataTable dt in ds.Tables)
{
Console.WriteLine(""Result set: {0}"", ++rsNumber);
foreach (DataRow row in dt.Rows)
A Run time error, multi result set is not supported by ADO.NET
B Nothing wong, multi result set is supported by ADO.NET
Which object that bellowed statements describe about?
Its is Read only !
Its connected to datasource
You must manage connection your self
Trang 21It use fewer server resource
A “#CustomerName”
B “%CustomerName”
C “@CustomerName”
Trang 22D “?CustomerName”
Which internal format DataSet uses to load and persist its contents?
A Which internal format DataSet uses to load and persist its contents?
B Binary Format
C No format is required
D CSV Format
What is a connection string?
A Specifies the type of ODBC driver to use, database format and filename
Trang 23B Specifies whether to use a DSN or DSN-less connection
C Opens the initial connection to a database
D Specifies which type of database is being used
Two users are trying to update the row in a database at the same time.Assuming that optimistic
concurrency is not used for concurrency control in this case, what will be the result ?
A The Second Update overwrites the first update
B Error will be raised when the Second update happens
C Second update does not happen at all
D None of the above
Which Dataset gives easier access to the contents of the table ?
Trang 25The "RejectChanges" method of Dataset is used to :
A "Commits the changes
"
B remove all datarow in it
Trang 26C Rollbacks all changes since last call to AcceptChanges
D Rolls back all changes since object was created
You decide to use named parameters in a SqlCommand object in order to execute SQL queries on a database You have a parameter named “CustomerName” How do you refer to it within the SQL query text in the SqlCommand object?
Trang 27The "ReSet" method of Dataset is used to :
A remove all datarow in it
B Commits the changes
Trang 29What is the sequential procedure in working with databases?
A Connection object, connection string, close connection object, close connection string
B Connection string, connection object, close connection string, close connection object
C Connection object, connection string, close connection string, close connection object
You use a TransactionScope in your application in your application in order to use transaction semantics What code should you use in order to commit the transaction within the transaction scope?
Trang 31Question 13 of 20 5.0/ 5.0 Points
You want to access data from the "Customer" table in the database You generate a DataSet named
"MyDataSet" by adding "Customer" table to it Which of the following statements should you use to load the data from the database into "MyDataSet" which has been loaded with multiple tables, using a SqlDataAdapter named "MyAdapter"?
Trang 32Question 15 of 20 5.0/ 5.0 PointsWhich of the following Namespace is used for better performance when connecting to SQLServer ?
Trang 33Question 17 of 20 5.0/ 5.0 PointsWhich type of Dataset supports schema ?
Database connectivity with ADO has 3 main objects:
A All of the above
B ADODB.Recordset
Trang 34What are the weekness of typed dataset
A.No re-use/upgrade model
Trang 35B.Lack of DataAccess features
C.Heavy object
D.Hight performance