1. Trang chủ
  2. » Công Nghệ Thông Tin

BTNB quiz4 database programming with ADO net

35 3,2K 2

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 35
Dung lượng 268,39 KB

Nội dung

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

Part of - Question of 20 73.33/ 100.0 Points 0.0/ 5.0 Points Which Dataset gives easier access to the contents of the table ? A Typed B UnTyped C Mixed Question of 20 Which of the following is not a member of ADODBCommand object? A ExecuteScalar B Open C ExecuteReader 0.0/ 5.0 Points D ExecuteStream Question of 20 5.0/ 5.0 Points Chose valid value for datarowstates ! A.Detached B.Modified C.Deleted D.Added Question of 20 What must your ASP code have if you are using the DSN method of connecting? A Both 5.0/ 5.0 Points B Connection object C Connection string Question of 20 What's wrong with these code: using System; using System.Data; using System.Data.SqlClient; class Program { static void Main(string[] args) { string sqlConnectString = ""Data Source=(local);"" + ""Integrated security=SSPI;Initial Catalog=AdventureWorks;""; string sqlSelect = ""SELECT TOP * FROM Sales.SalesOrderHeader;"" + ""SELECT TOP * 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) { Console.WriteLine(""{0}, {1}, {2}"", row[0], row[1], row[2]); } } } } 5.0/ 5.0 Points A Run time error, multi result set is not supported by ADO.NET B Nothing wong, multi result set is supported by ADO.NET Question 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 of 20 5.0/ 5.0 Points When we need to retrieve only a single value from the Database,which Method is efficient A ExecuteReader() B ExecuteXmlReader() C ExecuteNonQuery() D ExecuteScalar() Question of 20 5.0/ 5.0 Points 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 Question of 20 5.0/ 5.0 Points If the DSN (Data Source Name) has to be used with SQL Server, which namespace has to be imported ? A Sytem.Data.ODBC B Sytem.Data.ODBC C System.Data.SQLClient D System.Data.Oledb Question 10 of 20 Database connectivity with ADO has main objects: A All of the above B ADODB.Recordset C ADODB.Command D ADODB.Connection 5.0/ 5.0 Points Question 11 of 20 5.0/ 5.0 Points Which of the following Namespace is used for better performance when connecting to SQLServer ? A System.Data.Oledb B System.Data C System.Data.SQLClient D System.Data.OracleClient Question 12 of 20 5.0/ 5.0 Points Which method of DataTable can be used to return all changed rows since it was last loaded? A GetChanged() B GetChanges() C GetUpdated() D FindChanges() Question 13 of 20 5.0/ 5.0 Points 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 Question 14 of 20 How the SQL classes in Net Communicate to SQLServer ? A TDS - Tabular Data Stream 0.0/ 5.0 Points B OLEDB C ODBC D None of the above Question 15 of 20 5.0/ 5.0 Points 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 Question 16 of 20 DataSet object contains : 3.33/ 5.0 Points A.DataRow B.DataTable C.DataRelation D.DataColumn Question 17 of 20 5.0/ 5.0 Points Which method you invoke on the Data Adapter control to load your generated dataset? A ExecuteQuery( ) B Fill() C Read( ) Question 18 of 20 5.0/ 5.0 Points You have code that executes SQL statements on a database within the context of a SQLTransaction You It use fewer server resource A DataReader B DataView C DataTable D Dataset Question 16 of 20 0.0/ 5.0 Points 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 you refer to it within the SQL query text in the SqlCommand object? A “#CustomerName” B “%CustomerName” C “@CustomerName” D “?CustomerName” Question 17 of 20 5.0/ 5.0 Points 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 Question 18 of 20 What is a connection string? A Specifies the type of ODBC driver to use, database format and filename 0.0/ 5.0 Points 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 Question 19 of 20 5.0/ 5.0 Points 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 Question 20 of 20 Which Dataset gives easier access to the contents of the table ? 0.0/ 5.0 Points A Typed B UnTyped C Mixed Part of - Question of 20 61.25/ 100.0 Points 0.0/ 5.0 Points OLEDB Connection Pooling is handled by OLEDB.Net Provider and SQLClient Connection pooling is handled by A Windows 2000 Component Service B OLEDB Provider C SQL Provider D ODBC provider Question of 20 5.0/ 5.0 Points What must your ASP code have if you are using the DSN method of connecting? A Both B Connection object C Connection string Question of 20 The "RejectChanges" method of Dataset is used to : A "Commits the changes " B remove all datarow in it 5.0/ 5.0 Points C Rollbacks all changes since last call to AcceptChanges D Rolls back all changes since object was created Question of 20 0.0/ 5.0 Points 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 you refer to it within the SQL query text in the SqlCommand object? A “#CustomerName” B “%CustomerName” C “@CustomerName” D “?CustomerName” Question of 20 Which Dataset gives easier access to the contents of the table ? 0.0/ 5.0 Points A Typed B UnTyped C Mixed Question of 20 0.0/ 5.0 Points Can a dataset be returned by connecting Excel file as database? True False Question of 20 The "ReSet" method of Dataset is used to : A remove all datarow in it B Commits the changes 0.0/ 5.0 Points C a D Rollbacks all changes since last call to AcceptChanges Question of 20 5.0/ 5.0 Points How many types of Concurrency handling techniques in ADO.NET ? A B C D Question of 20 5.0/ 5.0 Points What information can a connection string contain about the database you are trying to connect to? A Pasword B Type of database C Location of database D All Of The Above Question 10 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 Question 11 of 20 5.0/ 5.0 Points 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? A TransactionScope.Commit(); B TransactionScope.IsCompleted = true; C TransactionScope.Complete(); D TransactionScope.Completed = true; Question 12 of 20 Chose valid value for datarowstates ! A.Detached B.Modified C.Deleted D.Added 1.25/ 5.0 Points Question 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"? A MyAdapter.Fill("MyDataSet") B MyAdapter.Fill("MyDataSet",Customer) C MyAdapter.FilI(MyDataSet) D MyAdapter.Fill(MyDataSet,"Customer") Question 14 of 20 DataTable.Copy() method also creates the copy of DataRows? True False 5.0/ 5.0 Points Question 15 of 20 5.0/ 5.0 Points Which of the following Namespace is used for better performance when connecting to SQLServer ? A System.Data.Oledb B System.Data C System.Data.SQLClient D System.Data.OracleClient Question 16 of 20 Which connection method requires a connection string? A DSN-less B Both C DSN 5.0/ 5.0 Points Question 17 of 20 5.0/ 5.0 Points Which type of Dataset supports schema ? A Mixed B Typed C UnTyped D Mixed Question 18 of 20 Database connectivity with ADO has main objects: A All of the above B ADODB.Recordset 5.0/ 5.0 Points C ADODB.Command D ADODB.Connection Question 19 of 20 0.0/ 5.0 Points Choose valid operations of DataSet object: A.WriteXml B.ReadBinary C.Copy D.ReadXml Question 20 of 20 What are the weekness of typed dataset A.No re-use/upgrade model 0.0/ 5.0 Points B.Lack of DataAccess features C.Heavy object D.Hight performance ... Concurrency handling techniques in ADO. NET ? A 0.0/ 5.0 Points B C D Question 11 of 20 5.0/ 5.0 Points Which object in ADO. Net is similar to the Recordset object of ADO ? A DataProvider B DataProvider... ADO. NET ? A B C D Question of 20 5.0/ 5.0 Points What information can a connection string contain about the database you are trying to connect to? A Pasword B Type of database C Location of database. .. 5.0 Points A Run time error, multi result set is not supported by ADO. NET B Nothing wong, multi result set is supported by ADO. NET Question of 20 0.0/ 5.0 Points Permistic concurency means A

Ngày đăng: 31/03/2017, 15:12

TỪ KHÓA LIÊN QUAN

w