Thursday, September 5, 2013

Posted by Unknown
No comments | 11:19 PM
#1 Question:
Read the following statement:

DataTable.Merge (DataTable, Boolean)

What is the boolean parameter?
more..

    a. This is an out parameter and returns the status of merging
    b. Determines whether duplicate data should be removed
    c. Indicates whether to preserve changes in the current DataTable
    d. None of the above

Answer: c. Indicates whether to preserve changes in the current DataTable
User answers:
2013-05-03 15:56:49
c. Indicates whether to preserve changes in the current DataTable
Bhanu(bhanukumars@yahoo.co.in)
http://msdn.microsoft.com/en-IN/library/wkk7s5zk.aspx


#2 Question:
We are iterating through the results received in a data reader named 'DReaderOrder,' which is created by using the connection 'SqlCon.' In between we need to retrieve some more values from the database, so we executed another command in the same connection to get the results in a new data reader named 'DReaderProduct.' What will be the result if we are using ADO.NET 2.0? (Note:Multiple Active Result Sets (MARS) is enabled in SQL Server 2005).
more..

    a. First data reader will immediately stop and new data reader starts reading
    b. First data reader will halt till the new data reader finishes reading
    c. Both will keep on reading records independent of each other
    d. We receive an exception 'System.InvalidOperationException'

Answer: b. First data reader will halt till the new data reader finishes reading
User answers:
2013-01-12 08:03:02
b. First data reader will halt till the new data reader finishes reading


#3 Question:
Which of the following is not true about CommandType.TableDirect?
more..

    a. TableDirect is only supported by the .NET Framework Data Provider for OLE DB
    b. Multiple table access is not supported when CommandType is set to TableDirect
    c. TableDirect does not accept table as a parameter
    d. None of the above

Answer:


#4 Question:
Read the following statements:

        Dim employeeDS As DataSet
       
        employeeDS.Tables.Add(new DataTable("FirstQTR"))

What will be the result of above code?
more..

    a. It will create a table named FirstQTR
    b. It does nothing because the object reference is not set to an instance of the dataset object
    c. It will produce an error because the object reference is not set to an instance of the dataset object
    d. None of the above

Answer:


#5 Question:
You have got a supplier data table named "DTSupp." To display records specifically with sorting, you employed a dataview as follows:

Dim DataViewSupp As DataView = DTSupp.DefaultView

What is the 'DataViewSupp' table view by default?
more..

    a. It is unfiltered and contains references to the records included in the table
    b. It is filtered on ID column and contains references to the records included in the table
    c. It is unfiltered and does not contain references to the records included in the table
    d. It is filtered on ID column and does not contain references to the records included in the table

Answer: a. It is unfiltered and contains references to the records included in the table
User answers:
2013-06-27 21:36:24
a. It is unfiltered and contains references to the records included in the table


#6 Question:
You have following data table structure:

Sales
-----------
SalemanId
OrderId
Price

How will you calculate the total amount generated by a salesman (with SalemanID =2201) if the name of DataTable is 'DatTab?' more..

    a. DatTab.Calculate("Sum(Price)", "SalemanID = 2201")
    b. DatTab.Compute("Sum(Price)", "SalemanID = 2201")
    c. DatTab.Calculate("SalemanId = 2201","Sum(Price)")
    d. DatTab.Compute("SalemanId = 2201","Sum(Price)")

Answer: b. DatTab.Compute("Sum(Price)", "SalemanID = 2201")
User answers:
2013-03-27 12:28:50
b. DatTab.Compute("Sum(Price)", "SalemanID = 2201")
2013-06-27 21:39:21
b. DatTab.Compute("Sum(Price)", "SalemanID = 2201")


#7 Question:
Read the following statements:

OleDbDataAdapter oOrderDetailsDataAdapter;
OleDbCommandBuilder oOrderDetailsCmdBuilder = New  OleDbCommandBuilder(oOrderDetailsDataAdapter);
oOrderDetailsDataAdapter.FillSchema(oDS, SchemaType.Source);

What is wrong in this code?
more..

    a. The parameters are incorrect for the FillSchema method
    b. OleDbCommandBuilder has no constructor
    c. oOrderDetailsDataAdapter has not been instantiated
    d. None of the above

Answer: c. oOrderDetailsDataAdapter has not been instantiated
User answers:
2013-06-27 21:40:46
c. oOrderDetailsDataAdapter has not been instantiated


#8 Question:
Which of the following options is ideally suited for managing database connections? more..

    a. Pass the open connection objects between the methods
    b. Close the connection as soon as database operation is done
    c. Open a global connection and keep on using it without reopening
    d. Within a transaction, a connection should be closed in each method and reopened in the other

Answer: b. Close the connection as soon as database operation is done
User answers:
2013-03-27 12:32:43
b. Close the connection as soon as database operation is done
2013-06-27 21:45:48
b. Close the connection as soon as database operation is done


#9 Question:
Which of the following statements is incorrect with regard to a CommandBuilder object? more..

    a. It creates insert, update, and delete queries on the fly
    b. It creates efficient queries in terms of performance
    c. A unique column must be selected as a part of the select query
    d. It can't work with queries having joins

Answer: b. It creates efficient queries in terms of performance
User answers:
2012-11-12 14:00:18
a. It creates insert, update, and delete queries on the fly
2013-01-19 16:27:13
b. It creates efficient queries in terms of performance
2013-06-27 21:49:19
b. It creates efficient queries in terms of performance


#10 Question:
You have an Odbc connection to the database. You want to pass a parameter named 'ProductName' of type Varchar to the select command object. If the product name to be passed is "Notebook", how will you do that with a data adapter named 'ADP?'
more..

    a. ADP.SelectCommand.Parameters.Add("@ProductName", OdbcType.VarChar, 80).Value = "Notebook";
    b. ADP.SelectCommand.Parameters.Add("@ProductName", Type.VarChar, 80) = "Notebook";
    c. ADP.SelectCommand.Parameter.Add("@ProductName", OdbcType.VarChar, 80).Value = "Notebook";
    d. ADP.SelectCommand.Parameter.Add("@ProductName", Type.VarChar, 80) = "Notebook";

Answer: a. ADP.SelectCommand.Parameters.Add("@ProductName", OdbcType.VarChar, 80).Value = "Notebook";
User answers:
2013-03-27 12:36:00
a. ADP.SelectCommand.Parameters.Add("@ProductName", OdbcType.VarChar, 80).Value = "Notebook";


#11 Question:
You defined a data adapter as follows:

Dim adap As New SqlDataAdapter("select * from products;select * from customers", New SqlConnection(ConnectionString))
Dim DataSet As New DataSet
adap.Fill(DataSet)

How will you pass the customers data to a data grid named as "dGrid"? more..

    a. dGrid.Fill(DataSet.Tables(1))
    b. dGrid.Fill(DataSet.Tables(2))
    c. dGrid.DataSource = DataSet.Tables(1)
    d. dGrid.DataSource = DataSet.Tables(2)

Answer: c. dGrid.DataSource = DataSet.Tables(1)
User answers:
2013-06-28 17:33:14
c. dGrid.DataSource = DataSet.Tables(1)


#12 Question:
You use a Command object to retrieve employee names from the employee table in the database. Which of the following will be returned when this command is executed using the ExecuteReader method?
more..

    a. DataRow
    b. DataSet
    c. DataTable
    d. DataReader

Answer: d. DataReader
User answers:
2013-01-22 19:42:26
d. DataReader


#13 Question:
One of your forms displays the list of all the Customers in a list box and all their details in the text boxes. On selecting a Customer in the list box, text boxes should show details of that customer. Which of the following is ideally suited for the purpose? more..

    a. Me.BindingContext(DataSet,TableName).Position
    b. Me.BindingContext(TableName, DataSet).Position
    c. Me.BindingContext(DataSet,TableName)
    d. Me.BindingContext(TableName, DataSet)

Answer: a. Me.BindingContext(DataSet,TableName).Position
User answers:
2013-06-28 17:40:17
a. Me.BindingContext(DataSet,TableName).Position


#14 Question:
You have to update some values in the database. Which of the following methods would you execute on a command object named "cmdUpdate?" more..

    a. cmdUpdate.ExecuteScalar()
    b. cmdUpdate.ExecuteNonQuery()
    c. cmdUpdate.ExecuteReader()
    d. cmdUpdate.Execute()
    e. ExecuteXmlReader()

Answer: b. cmdUpdate.ExecuteNonQuery()
User answers:
2013-06-28 17:42:19
b. cmdUpdate.ExecuteNonQuery()


#15 Question:
Premium Finance Corp is involved in the savings business with branches all over the country. They provide flexible schemes which can be designed according the client's requirements. A dataset maintains all schemes in separate tables. You want to show all the schemes in different datagrids which should be created in the same sequence as the tables are in dataset. Which of the following is the most suitable method in the current scenario?
more..

    a. Write a loop for the tables() collection and call CreateDataReader for each table and bind with a dynamically generated datagrid
    b. Call GetXMLSchema, create an XML file and then bind with a dynamically generated datagrid
    c. Create datagrids for each table and bind with the relevant table
    d. None of the above

Answer: c. Create datagrids for each table and bind with the relevant table
User answers:
2013-06-28 17:47:07
c. Create datagrids for each table and bind with the relevant table


#16 Question:
You have a data table named 'DTable.' You are writing a sub routine to validate the changes made by the user. Which of the following would you use to get the changed table data? more..

    a. DTable.GetChanges(DataRowState.Modified)
    b. DTable.GetChanges(DataRowsModified)
    c. DTable.TableChanges(DataRowState.Modified)
    d. DTable.TableChanges(DataRowsModified)

Answer: a. DTable.GetChanges(DataRowState.Modified)
User answers:
2013-06-28 17:48:33
a. DTable.GetChanges(DataRowState.Modified)


#17 Question:
Which of the following is the parent class of DataAdapter?
more..

    a. Component
    b. DataSet
    c. ComponentModel
    d. SqlClient

Answer: a. Component
User answers:
2013-06-28 17:59:41
a. Component


#18 Question:
What are the core components of .Net framework data provider model? more..

    a. DataAdapter and DataReader
    b. Connection and Command
    c. DataAdapter, Connection, and Command
    d. DataAdapter , DataReader, Connection, and Command

Answer: d. DataAdapter , DataReader, Connection, and Command
User answers:
2013-06-07 08:59:40
d. DataAdapter , DataReader, Connection, and Command
d. DataAdapter , DataReader, Connection, and Command


#19 Question:
Read the following statements:

Dim dr As DataRow
Dim objCustReader As Data.SqlClient.SqlDataReader
Dim dtCustomers As DataTable

With dtCustomers.Columns.Add(New DataColumn("Customer ID")
End With

What is wrong in above code? more..

    a. Add is not a method of the Columns collection
    b. Column collection should be used instead of columns collection
    c. The Data Type of the column is a required parameter of 'Add' method
    d. None of the above

Answer: d. None of the above
User answers:
2013-06-28 18:07:23
d. None of the above


#20 Question:
Read the following statements:

DataRow oDetailsRow = oDS.Table["OrderDetails"].NewRow();
oDetailsRow["ProductId"] = 1;
oDetailsRow["ProductName"] = "Product 1";

What is wrong with this code?
more..

    a. Table is not a collection of DataSet
    b. Name of the column can not be passed in the Columns collection
    c. NewRow is not a method of the Tables collection
    d. None of the above

Answer:


#21 Question:
We are iterating through the results received in a data reader named 'DReaderOrder,' which is created by using connection 'SqlCon.' In between, we need to retrieve some more values from the database, so we executed another command using 'SqlCon,' to get the results in another data reader 'DReaderProduct.' What will happen if we use ADO.NET 1.1? more..

    a. First data reader will immediately stop and new data reader starts reading
    b. First data reader will halt till the new data reader finishes reading
    c. Both will keep on reading records independent of each other
    d. We receive an exception 'Systerm.InvalidOperationException'

Answer: a. First data reader will immediately stop and new data reader starts reading
User answers:
2013-01-03 17:15:34
b. First data reader will halt till the new data reader finishes reading
2013-04-03 15:52:14
a. First data reader will immediately stop and new data reader starts reading


#22 Question:
ADO.NET 2.0 provides a simple way of copying the complete table from one data source(/database) to another. What is the class providing this functionality known as? more..

    a. BulkCopy
    b. SQLBulkCopy
    c. OleDbBulkCopy
    d. CopyTable

Answer: b. SQLBulkCopy
User answers:
2013-03-27 12:51:25
b. SQLBulkCopy
2013-06-28 18:32:09
b. SQLBulkCopy


#23 Question:
You have defined a command named 'comA' and an open connection named 'con'. You created a new transaction:

Dim trans As SqlClient.SqlTransaction = Nothing

How will you assign the command to the transaction and begin the transaction?
more..

    a. cmdA.Transaction = trans
    cmdA.ExecuteNonQuery()
    b. trans.BeginTransaction()
    cmdA.Transaction = trans
    cmdA.ExecuteNonQuery()
    c. trans = con.BeginTransaction()
    cmdA.Transaction = trans
    cmdA.ExecuteNonQuery()
    d. trans = con.OpenTransaction()
    cmdA.Transaction(trans)
    cmdA.ExecuteNonQuery()

Answer: c. trans = con.BeginTransaction()<br>cmdA.Transaction = trans<br>cmdA.ExecuteNonQuery()<br>
User answers:
2013-06-28 18:36:53
c. trans = con.BeginTransaction()<br>cmdA.Transaction = trans<br>cmdA.ExecuteNonQuery()<br>


#24 Question:
Which of the following is not a valid member of DataAdapter?
more..

    a. AcceptChanges
    b. acceptchangesDuringFill
    c. Container
    d. TableMappings

Answer: a. AcceptChanges
User answers:
2013-03-27 12:53:15
a. AcceptChanges
2013-06-28 18:41:33
a. AcceptChanges


#25 Question:
Which of the following is not a valid method of DataAdapter?
more..

    a. Fill
    b. FillSchema
    c. HasChanges
    d. Update

Answer: c. HasChanges
User answers:
2013-01-22 19:45:35
c. HasChanges
2013-06-28 18:53:25
c. HasChanges


#26 Question:
Which of the following are valid methods of the SqlTransaction class?
more..

    a. Commit
    b. Terminate
    c. Save
    d. Close
    e. Rollback

Answer: a. Commit
c. Save
e. Rollback
User answers:
2013-03-27 12:54:50
a. Commit
c. Save
e. Rollback
2013-06-28 19:04:37
a. Commit
c. Save
e. Rollback


#27 Question:
The WriteXml method of a DataSet writes the data of the DataSet in an XML file. WriteXml accepts a parameter for the different types of destinations. Which of the following is an invalid type for the destination?
more..

    a. String
    b. System.IO.Stream
    c. System.IO.TextStream
    d. System.IO.TextWriter
    e. System.Xml.XmlWriter

Answer: b. System.IO.Stream
User answers:
2013-03-08 16:11:31
b. System.IO.Stream


#28 Question:
Which of the following statements is true with regard to DataRow and DataRowView? more..

    a. The DataRowView object is a wrapper for the reference to the DataRow object
    b. The DataRow object can be accessed from a DataRowView
    c. Both are safe for multithreaded read operations
    d. All of the above

Answer: d. All of the above
User answers:
2013-06-28 19:17:58
d. All of the above


#29 Question:
Which of the following implements IDataReader interface? more..

    a. SqlDataReader
    b. OleDbDataReader
    c. OracleDataReader
    d. ODBCDataReader
    e. All of the above

Answer: e. All of the above
User answers:
2013-06-28 20:17:31
e. All of the above


#30 Question:
Which of the following statements are correct?

(a)A DataReader doesn't have an iterator or a rows collection
(b)When DataReader reaches the last row, its Read() method will return false
more..

    a. Only (a) is true
    b. Only (b) is true
    c. Both (a) and (b) are true
    d. Both (a) and (b) are false

Answer: c. Both (a) and (b) are true
User answers:
2012-10-03 15:24:21
c. Both (a) and (b) are true
2013-06-28 20:20:54
c. Both (a) and (b) are true


#31 Question:
How can you make a data reader close connection automatically? more..

    a. command.ExecuteReader()
    b. command.ExecuteReader(CommandBehavior.Default)
    c. command.ExecuteReader(CommandBehavior.CloseConnection)
    d. command.ExecuteReader(CommandBehavior.SingleRequest)

Answer: c. command.ExecuteReader(CommandBehavior.CloseConnection)
User answers:
2013-03-27 12:59:48
c. command.ExecuteReader(CommandBehavior.CloseConnection)
2013-06-28 20:23:22
c. command.ExecuteReader(CommandBehavior.CloseConnection)


#32 Question:
Which of the following statements is correct with regard to transaction? more..

    a. A transaction can have multiple command objects assigned to it
    b. A transaction can have only one command object assigned to it
    c. One command object must be executed before assigning another command to the transaction
    d. A transaction ends with EndTransaction() on connection object

Answer: a. A transaction can have multiple command objects assigned to it
User answers:
2013-06-29 05:55:19
a. A transaction can have multiple command objects assigned to it


#33 Question:
The DataSet object can extract data from an XML file. The ReadXML method accepts the source as a parameter and returns a value from the xmlReadMode enumeration. Which of the following is an invalid option of XmlReadMode?
more..

    a. ReadSchema
    b. InferSchema
    c. IgnoreSchema
    d. Fragment
    e. DiffGramSchema

Answer: e. DiffGramSchema
User answers:
2013-03-27 13:01:48
e. DiffGramSchema
2013-06-29 06:14:07
e. DiffGramSchema


#34 Question:
Which of the following is not associated with the command��object in ADO.NET 2.0? more..

    a. cmd.ExecuteScalar()
    b. cmd.ExecutePageReader()
    c. cmd.ExecuteReader()
    d. cmd.ExecuteXmlReader()
    e. cmd.Execute()

Answer: b. cmd.ExecutePageReader()
e. cmd.Execute()
User answers:
2013-03-27 13:02:44
b. cmd.ExecutePageReader()
e. cmd.Execute()
2013-06-29 06:16:03
b. cmd.ExecutePageReader()
e. cmd.Execute()


#35 Question:
You have added some rows to the existing datatable in the dataset. Which of the following methods would you invoke? more..

    a. DataSet.Merge(NewRows[])
    b. DataSet.Add(NewRows[])
    c. DataSet.AddRows(NewRows[])
    d. DataSet.Include(NewRows[])

Answer: a. DataSet.Merge(NewRows[])
User answers:
2013-03-27 13:03:36
a. DataSet.Merge(NewRows[])
2013-06-29 06:19:44
a. DataSet.Merge(NewRows[])


#36 Question:
Read the following statements:

DataRow oDetailsRow = oDS.Tables["OrderDetails"].Row();
oDetailsRow["ProductId"] = 1;
oDetailsRow["ProductName"] = "Product 1";

What is wrong in this code?
more..

    a. The name of the table can not be passed in the Tables collection
    b. The name of the column can not be passed in the Columns collection
    c. Row is not a method of the Tables collection
    d. None of the above

Answer: c. Row is not a method of the Tables collection
User answers:
2013-03-27 13:04:42
c. Row is not a method of the Tables collection
2013-06-29 06:28:26
c. Row is not a method of the Tables collection


#37 Question:
Which of the following are invalid values of a Dataset's SchemaSerializationMode property?
more..

    a. CreateSchema
    b. DeleteSchema
    c. IncludeSchema
    d. ExcludeSchema
    e. None of the above

Answer: a. CreateSchema
b. DeleteSchema
e. None of the above
User answers:
2013-03-27 13:05:18
a. CreateSchema
b. DeleteSchema
e. None of the above
2013-06-29 06:32:07
a. CreateSchema
b. DeleteSchema
e. None of the above
http://msdn.microsoft.com/en-us/library/system.data.dataset.schemaserializationmode.aspx


#38 Question:
You must create a stored procedure to retrieve the following details for the given customer:

CustomerName, Address, PhoneNumber

Which of the following is an ideal choice to get the result? more..

    a. Return the result as dataset using data adapter
    b. Return the result as dataset using command object
    c. Return the result as three out parameters and command object
    d. All of the above

Answer: c. Return the result as three out parameters and command object
User answers:
2013-06-29 06:37:06
c. Return the result as three out parameters and command object


#39 Question:
Which of the following statements is incorrect with regard to ADO? more..

    a. ADO uses recordset whereas ADO.NET uses dataset
    b. ADO navigation approach is non-sequential, whereas in ADO.NET it's sequential
    c. Disconnected access in ADO has to be coded explicitly, whereas ADO.NET handles it with the adapter
    d. ADO offers hierarchical RecordSet for relating multiple tables, whereas ADO.NET provides data relations

Answer: b. ADO navigation approach is non-sequential, whereas in ADO.NET it's sequential
User answers:
2013-06-29 06:39:04
b. ADO navigation approach is non-sequential, whereas in ADO.NET it's sequential


#40 Question:
ADO.NET 2.0 has a new feature that allows you to run more than one DataReader from the same connection at the same time. Which of the following properties must be true for multiple DataReaders?
more..

    a. MUDR
    b. OMDR
    c. MARS
    d. MDRC

Answer: c. MARS
User answers:
2012-08-27 22:49:14
c. MARS
2013-01-27 12:55:06
c. MARS
c
2013-06-29 06:43:15
c. MARS
Multiple Active Result Sets(MARS)
http://msdn.microsoft.com/en-us/library/h32h3abf%28v=vs.80%29.aspx


#41 Question:
How you can you verify whether a dataset has changed? more..

    a. dataset.HasChanged
    b. dataset.HasChanges
    c. dataset.HasModification
    d. dataset.HasAltered

Answer: b. dataset.HasChanges
User answers:
2013-06-29 06:48:33
b. dataset.HasChanges
The HasChanges method of a dataset returns true if changes have been made in the dataset.
http://msdn.microsoft.com/en-us/library/zky7370c.aspx


#42 Question:
You have got the data view of the customer table named "ViewCust." Before displaying the records in the grid, you want to retrieve the CustomerIDs with a value less than 50. How will you do this? more..

    a. ViewCust.RowFilter("CustomerID < 50")
    b. ViewCust.Filter = "CustomerID < 50"
    c. ViewCust.Filter("CustomerID > 50")
    d. ViewCust.RowFilter = "CustomerID > 50"

Answer: d. ViewCust.RowFilter = "CustomerID &gt; 50"
User answers:
2013-06-29 07:52:15
d. ViewCust.RowFilter = "CustomerID &gt; 50"
http://msdn.microsoft.com/en-us/library/vstudio/system.data.dataview.rowfilter%28v=vs.100%29.aspx


#43 Question:
Which of the following represents the possible values for the 'DataRowVersion' class? more..

    a. Current,Revised,Original, and Modified
    b. Revised,Default,Original, and Modified
    c. Current,Default,Edited, and Proposed
    d. Current,Default,Original, and Proposed

Answer: d. Current,Default,Original, and Proposed
User answers:
2013-06-29 08:00:02
d. Current,Default,Original, and Proposed
Describes the version of a DataRow.
http://msdn.microsoft.com/en-us/library/system.data.datarowversion%28v=vs.71%29.aspx


#44 Question:
You have a data table named 'ProdDT' and its modified version named 'ModProdDT.' Which of the following would you use to update the changes, using 'ProdAdp' adapter and 'DS' data set? more..

    a. ProdAdp.UpdateDataTable(ModProdDT)
    DS.ProdDT.AcceptChanges()
    b. ProdAdp.UpdateDataTable(ModProdDT)
    DS.ProdDT.Accept()
    c. ProdAdp.Update(ModProdDT)
    DS.ProdDT.AcceptChanges()
    d. ProdAdp.Update(ModProdDT)
    DS.ProdDT.Accept()

Answer:


#45 Question:
Asynhronous execution is supported in ADO.NET 2.0 for ExecuteReader, ExecuteScalar, and ExecuteNonQuery. more..

    a. True
    b. False

Answer:


#46 Question:
Premium Finance Corp is running a home loans business. Sometimes a client just wants to see his total amount paid. For this, the application runs a query which returns a single value. Which of the following techniques will you prefer to use in the current scenario? more..

    a. DataReader
    b. DataAdapter
    c. Command object's ExecuteScalar
    d. None of the above

Answer:


#47 Question:
Premium Finance Corp is running a home loans business. They are planning to create a website to automate the business. An aspx page, Sales.aspx will show the sales made by an executive through a datagrid. The data is not editable. Which of the following options you will choose to extract data? more..

    a. DataReader
    b. DataAdapter
    c. Command object's ExecuteScalar
    d. None of the above

Answer:


#48 Question:
Which of the following statements are correct?

(a)SQL statements are generally faster than stored procedures
(b)The database engine works out the execution plan for SQL statements at run time more..

    a. Only (a) is true
    b. Only (b) is true
    c. Both (a) and (b) are true
    d. Both (a) and (b) are false

Answer:


#49 Question:
You have defined an SQL Command object named "sqlComm" to run a stored procedure. The OUT parameter is as follows:

Dim pm2 As New SqlParameter("@Amount," SqlDbType.Money)

How will you add the OUT parameter named pm2 to the command object? more..

    a. sqlComm.Parameters.Add(pm2)
    b. sqlComm.Parameters.Add(pm2).Mode = ParameterMode.Output
    c. sqlComm.Parameters.Add(pm2).Direction = ParameterDirection.Output
    d. sqlComm.Parameters.Add(pm2).Direction = ParameterDirection.ReturnValue

Answer: c. sqlComm.Parameters.Add(pm2).Direction = ParameterDirection.Output
User answers:
2013-06-29 08:35:25
c. sqlComm.Parameters.Add(pm2).Direction = ParameterDirection.Output


#50 Question:
Which of the following statements is correct with regard to a CommandBuilder object? more..

    a. It creates update/delete command based on the primary key column
    b. It creates update/delete command based on all the identity columns
    c. It creates update/delete command based on original values of all the selected columns
    d. It creates update/delete command according to its internal algorithm

Answer: a. It creates update/delete command based on the primary key column
User answers:
2013-06-29 08:53:27
a. It creates update/delete command based on the primary key column
http://msdn.microsoft.com/en-us/library/tf579hcz.aspx


#51 Question:
Which of the following is not correct with regard to DataReader and DataSet? more..

    a. DataReader reads one row from the database
    b. DataSet gets complete set of data from the database
    c. DataReader can only get its data from a data source through a managed provider
    d. DataReader closes its connection automatically

Answer: d. DataReader closes its connection automatically
User answers:
2013-06-29 08:58:23
d. DataReader closes its connection automatically


#52 Question:
A stored procedure takes a single parameter (storeid) and returns the product sales for that store. The user can view the sales for that store. Which ADO object should you use to execute the Sp_store_sales stored procedure in a situation where the user can repeat the same action for different stores? more..

    a. Parameter
    b. Recordset
    c. Connection
    d. Command

Answer: d. Command
User answers:
2013-07-28 06:29:13
d. Command


#53 Question:
Premium Finance Corp is involved in the savings business with branches all over the country. They provide flexible schemes which can be designed according the client's requirements. A dataset maintains all schemes in separate tables. Whenever a new scheme is created, the dataset creates a new table but it must be checked that the new table name should not already exist. Which method of the Tables collection should be used to check whether the table already exists? more..

    a. Contains
    b. Exists
    c. Duplicate
    d. Created

Answer: a. Contains
User answers:
2013-06-29 09:08:05
a. Contains


#54 Question:
You are using Visual Basic to retrieve class information from a Microsoft SQL Server database named ClassList. The database resides on a server named Neptune. Which code fragment will create a connection to this data source? more..

    a. Set conn = New SqlConnection; With conn ; .Provider = "SqlOleDB" ; ConnectionString ="User ID=sa;"&& "Data Source=Neptune;"&& "Initial Catalog=ClassList"
    b. Set conn = New SqlConnection; With conn ; .Provider = "Neptune" ; ConnectionString ="User ID=sa;"&& "Data Source=Neptune;"&& "Initial Catalog=ClassList"
    c. Set conn = New SqlConnection; With conn ; .Provider = "SqlOleDB" ; ConnectionString ="User ID=sa;"&& "Data Source= Neptune;"

Answer: a. Set conn = New SqlConnection; With conn ; .Provider = "SqlOleDB" ; ConnectionString ="User ID=sa;"&amp;&amp; "Data Source=Neptune;"&amp;&amp; "Initial Catalog=ClassList"
User answers:
2013-06-29 09:11:02
a. Set conn = New SqlConnection; With conn ; .Provider = "SqlOleDB" ; ConnectionString ="User ID=sa;"&amp;&amp; "Data Source=Neptune;"&amp;&amp; "Initial Catalog=ClassList"


#55 Question:
Which of the following options should you use to copy the edited rows from a dataset called ProductInfo into another dataset called ProductChanges? more..

    a. productChanges = productInfo.GetChanges(DataRowState.Detached)
    b. productChanges = productInfo.GetChanges()
    c. productChanges.Merge(productInfo, true)
    d. productChanges.Merge(productInfo, false)

Answer:


#56 Question:
Which of the following was not among the main design goals behind ADO NET? more..

    a. To provide seamless support for XML
    b. To support COM directly
    c. To provide an expandable and scalable data access architecture for the revolutionary n-tier programming model
    d. To extend the current capabilities of ADO

Answer:


#57 Question:
Which of the following statements with regard to DataSet is correct? more..

    a. A DataSet can derive data from a database
    b. A DataSet can derive data from an xml file
    c. A DataSet can derive data from both xml file and a database
    d. A DataSet can be used to view data only
    e. Datasets store data in a disconnected cache

Answer: a. A DataSet can derive data from a database
b. A DataSet can derive data from an xml file
c. A DataSet can derive data from both xml file and a database
e. Datasets store data in a disconnected cache
User answers:
2013-06-29 10:03:46
a. A DataSet can derive data from a database
b. A DataSet can derive data from an xml file
c. A DataSet can derive data from both xml file and a database
e. Datasets store data in a disconnected cache


#58 Question:
ADO.NET is known for disconnected data extraction. Which of the following does not use the disconnected mechanism while extracting data from the database? more..

    a. DataAdapter
    b. DataReader
    c. DataSet
    d. None of the above

Answer: b. DataReader
User answers:
2013-06-29 10:08:12
b. DataReader


#59 Question:
Which of the following are true Serializable objects (i.e. they implement ISerializable interface)? more..

    a. DataSet and DataView
    b. DataRow and DataTable
    c. DataColumn and DataView
    d. DataSet and DataTable

Answer: d. DataSet and DataTable
User answers:
2013-06-29 10:17:43
d. DataSet and DataTable
[SerializableAttribute]
public class DataTable : MarshalByValueComponent, IListSource,
ISupportInitializeNotification, ISupportInitialize, ISerializable, IXmlSerializable


[SerializableAttribute]
public class DataSet : MarshalByValueComponent, IListSource, IXmlSerializable, ISupportInitializeNotification,
ISupportInitialize, ISerializable
http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx


#60 Question:
BrainGrip has a class called DBConnectivity. Every page of the site is using this class to get the connection object. You are using SQL Server 2005.

Imports System.Data.OleDB
Imports System.Web

Namespace BrainGrip
Class DatabaseConnectivity
Private oConn As New OleDbConnection()

Public Function GetConnection(ByVal sDbPath As String) As OleDbConnection
oConn.ConnectionString = "Provider=Microsoft.jet.oledb.4.0;Data Source=" & sDbPath
oConn.Open()
GetConnection = oConn
End Function
End Class
End Namespace

When this class is compiled, it produces an exception. Which part of the code would be the most likely cause of the exception? more..

    a. Imports System.Data.OleDB
    b. Class DatabaseConnectivity
    c. Private oConn As New OleDbConnection()
    d. oConn.ConnectionString
    e. None of the above

Answer: e. None of the above
User answers:
2013-06-29 10:22:38
e. None of the above


#61 Question:
You have to retrieve the details of some members from the 'Member' table. The data reader is executed to get the values. Which of the following helps go through the results? more..

    a. DataReader.Next
    b. DataReader.Move
    c. DataReader.Read
    d. DataReader.MoveNext

Answer: c. DataReader.Read
User answers:
2013-06-29 10:28:00
c. DataReader.Read
Advances the reader to the next block of data in cases where the reader contains more than one block.
http://msdn.microsoft.com/en-us/library/Microsoft.VisualStudio.Data.DataReader_methods%28v=vs.80%29.


#62 Question:
Which of the following is not a valid property of the connection object? more..

    a. LockType
    b. ConnectionString
    c. ConnectionTimeout
    d. Provider

Answer: a. LockType
User answers:
2013-06-29 10:46:02
a. LockType


#63 Question:
In .Net application, you have to update 40 records together in the update query. Previous versions of ADO.NET would be making 40 calls to database. Which of the following parameters is set to 40 with version 2.0? more..

    a. DataAdapter.UpdateBatchSize
    b. DataAdapter.UpdateSize
    c. DataAdapter.BatchSize
    d. DataAdapter.BatchRecordSize

Answer: a. DataAdapter.UpdateBatchSize
User answers:
2013-06-29 10:48:55
a. DataAdapter.UpdateBatchSize


#64 Question:
A banking application is online. As soon as Martin finished his session, Lisa logged on and did some banking. The connection string created for each of them is as follows:

String ConnStr= "Server=BankServer;Database=BankDB;User=Martin;Password=gilbo123;"

String ConnStr= "Server=BankServer;Database=BankDB;User=Lisa;Password=kari75;"

Which of the following statements will be correct in case the connection pooling is also switched on? more..

    a. There is a possibility of Lisa using the same connection object as created for Martin from the connection pool
    b. Lisa can not use someone else's connection from the connection pool
    c. Lisa can pick any other idle connection from the connection pool
    d. None of the above

Answer:


#65 Question:
When users edit data in your program, the code runs to completion without error, but no data changes appear in the database. You test the update query and the connection string that you are passing to the procedure, and they both work correctly. What changes do you need to make to your code to ensure that data changes appear in the database? more..

    a. Add the following two lines of code before calling the Update method:

       Dim cb As New OleDb.OleDbCommandBuilder(da)
       cb.GetUpdateCommand()
    b. Add the following line of code before calling the Update method:

       da.UpdateCommand.Connection.Open()
    c. Delete this line of code:

       dataTable.AcceptChanges()
    d. Delete this line of code:

       da.Dispose()

Answer:


#66 Question:
Which of the following is not a member of the CommandType enumeration? more..

    a. Table
    b. storedProcedure
    c. TableDirect
    d. Text

Answer: a. Table
User answers:
2013-06-29 10:56:29
a. Table
http://msdn.microsoft.com/en-us/library/system.data.commandtype.aspx


#67 Question:
Which of the following are used for database connections between SQL Server and ASP.NET? more..

    a. SqlInfoMessageEvent
    b. SqlParameterCollection
    c. SqlRowUpdatingEvent
    d. SqlClientPermissionAttribute

Answer: a. SqlInfoMessageEvent
c. SqlRowUpdatingEvent
User answers:
2013-06-29 11:09:03
a. SqlInfoMessageEvent
c. SqlRowUpdatingEvent


#68 Question:
You have written a function to generate a unique bill number for every new bill:

1 Public Function getNewBillNo() As Integer
2        Dim cm As New SqlCommand("select max(billno) from bill", con)
3        con.Open()
4               
5     
6 End Function

You want to return "1" as new ID, if there exists no record in the database. Otherwise, the return value should be the maximum bill number plus one. What should follow in line 4, if you want to check for Null values as well? more..

    a. Return (IIf(IsNull(cm.ExecuteNonQuery), 1, cm.ExecuteNonQuery +1))
    b. Return (IIf(IsDBNull(cm.ExecuteScalar), 1, cm.ExecuteScalar +1 ))
    c. Return (IIf(IsNull(cm.ExecuteScalar), 1, cm.ExecuteScalar))
    d. Return (IIf(IsDBNull(cm.ExecuteNonQuery), cm.ExecuteNonQuery ,1))

Answer: b. Return (IIf(IsDBNull(cm.ExecuteScalar), 1, cm.ExecuteScalar +1 ))
User answers:
2013-06-29 11:13:15
b. Return (IIf(IsDBNull(cm.ExecuteScalar), 1, cm.ExecuteScalar +1 ))


#69 Question:
Which of the following is capable of returning multiple rows and multiple columns from the database? more..

    a. ExecuteReader
    b. ExecuteXmlReader
    c. Adapter.fill
    d. All of the above

Answer:


#70 Question:
Two users, Monique and James are using ADO.NET MIS system. The data refresh time in the system is set to 15 minutes. James changed the mailing address of a customer named Majda, and updated the database. Before database refresh, Monique also updated the same customers address as per her pending requests folder. Monique and James are using SqlCommandBuilder class for construction of SQL statements. What will happen when Monique saves the changes? more..

    a. Changes made by Monique will be saved by the database
    b. Changes made by Monique will be ignored and nothing unusual happens
    c. DBConcurrencyException will be thrown
    d. DBException will be thrown

Answer:


#71 Question:
DataSet is a sort of virtual database which can maintain tables as well as relationships. Which of the following have correct parameters for the add method of the relations collection? (Select all which applies) more..

    a. name as String
    b. relation as System.Data.DataRelation
    c. name as String,relation as System.Data.DataRelation
    d. name as String, parentColumns() As System.Data.DataColumn, childColumns() As System.Data.DataColumn
    e. parentColumns() As System.Data.DataColumn, childColumns() As System.Data.DataColumn

Answer: b. relation as System.Data.DataRelation
d. name as String, parentColumns() As System.Data.DataColumn, childColumns() As System.Data.DataColumn
e. parentColumns() As System.Data.DataColumn, childColumns() As System.Data.DataColumn
User answers:
2013-06-29 15:18:08
b. relation as System.Data.DataRelation
d. name as String, parentColumns() As System.Data.DataColumn, childColumns() As System.Data.DataColumn
e. parentColumns() As System.Data.DataColumn, childColumns() As System.Data.DataColumn


#72 Question:
PreFin101.com has a guest book which uses an XML document. Initially, an XML file is uploaded into the datatable. As records increase, the 'GuestID' column should be incremented. Which properties of the column will be used to implement the auto increment functionality?
     more..

    a. AutoIncrementSeed
    b. AutoIncrementStep
    c. AutoIncrement
    d. AutoIncrementNumber
    e. AutoIncrementIndex

Answer: a. AutoIncrementSeed
b. AutoIncrementStep
c. AutoIncrement
User answers:
2013-06-29 15:23:28
a. AutoIncrementSeed
b. AutoIncrementStep
c. AutoIncrement


#73 Question:
Premium Corporation is running an insurance business. They are planning to create a website to automate the business. An aspx page, Sales.aspx will display the sales generated by an executive. The sales will be displayed in a datagrid. The executives can change some fields like the address or phone numbers of clients, and they can add new sales also. Which of the following will you prefer to use for this? more..

    a. DataReader
    b. DataAdapter
    c. Command object's ExecuteNonQuery
    d. DataReader with Command object's ExecuteNonQuery
    e. None of the above

Answer:


#74 Question:
Which of the following is not associated with the command  object in ADO.NET 2.0? more..

    a. cmd.ExecuteScalar()
    b. cmd.ExecutePageReader()
    c. cmd.ExecuteReader()
    d. cmd.ExecuteXmlReader()
    e. cmd.Execute()

Answer: b. cmd.ExecutePageReader()
e. cmd.Execute()
User answers:
2013-06-29 15:38:15
b. cmd.ExecutePageReader()
e. cmd.Execute()


#75 Question:
Read the following statement:

DataTable.Select (String, String)

Here, the first parameter accepts a criteria for filtration, what does the second parameter do? more..

    a. Specifies the sort order
    b. Accepts another criteria
    c. Specifies the column name which should be searched
    d. Header of output

Answer: a. Specifies the sort order
User answers:
2013-06-29 15:40:19
a. Specifies the sort order


#76 Question:
ADO.NET 2.0 provides a way to get all the data from data reader into a DataTable. How is this special functionality invoked? more..

    a. DataTable.Load(DataReader)
    b. DataReader.Load(DataTable)
    c. DataTable.DataSource=DataReader
    d. DataReader.Fill(DataTable)

Answer: a. DataTable.Load(DataReader)
User answers:
2013-06-29 15:44:49
a. DataTable.Load(DataReader)


#77 Question:
Which of the following command types are provided by an oledb and sql provider? more..

    a. StoredProcedure,Text, TableDirect
    b. StoredProcedure,Query, TableDirect
    c. Procedure,Text,Table,Query
    d. Procedure,Query, TableDirect

Answer:


#78 Question:
A stored procedure called 'FirstQTR' is used for generating the sales report of the first quarter. Apart from other data, it returns the total sale seperately to make a hyperlink. For this purpose you pass a parameter, TotalSale. Which of the following statements suits for the parameter TotalSale? more..

    a. sqlComm.Parameters.Add(TotalSale,Out)
    b. sqlComm.Parameters.Add(TotalSale).Mode = ParameterDirection.Output
    c. sqlComm.Parameters.Add(TotalSale).Direction =  Parameter.Output
    d. sqlComm.Parameters.Add(TotalSale).Direction = ParameterDirection.Output

Answer: d. sqlComm.Parameters.Add(TotalSale).Direction = ParameterDirection.Output
User answers:
2013-06-29 15:55:19
d. sqlComm.Parameters.Add(TotalSale).Direction = ParameterDirection.Output


#79 Question:
Which of the following methods ensures optimum use of Connection Pooling? more..

    a. By using current user's login for authentication and getting the connection
    b. By using a common account login for authentication and getting the connection
    c. By using a current user's login for authentication and using 'common account login' for getting the connection
    d. None of the above

Answer: c. By using a current user's login for authentication and using 'common account login' for getting the connection
User answers:
2013-06-29 16:00:45
c. By using a current user's login for authentication and using 'common account login' for getting the connection


#80 Question:
Which of the following can not be bound? more..

    a. DataViewManager
    b. DataTable
    c. DataColumn
    d. DataView
    e. All of the above can be bound

Answer: c. DataColumn
User answers:
2013-06-29 16:04:49
c. DataColumn


#81 Question:
Which of the following methods is ideally suited for retrieving a single row and single column from the database? more..

    a. By using fill method of the data adapter
    b. By using ExecuteReader method of the command object
    c. By using ExecuteScalar method of the command object
    d. All of the above

Answer: c. By using ExecuteScalar method of the command object
User answers:
2013-06-29 16:14:14
c. By using ExecuteScalar method of the command object


#82 Question:
You have two parent and child data tables named 'DTOrder' and 'DTOrderDetail' respectively. Both are stored in a data set named 'DS.' How will you make a relation 'DTOrder2DTOrderDetail' between the two, using 'OrderId' as primary key? more..

    a. DS.Relation.Add("DTOrder2DTOrderDetail",
    DS.Tables["DTOrder"].Columns["OrderId"],
    DS.Tables["DTOrderDetail"].Columns["OrderId"])
    b. DS.Relations.Add("DTOrder2DTOrderDetail",
    DS.Tables["DTOrder"].Columns["OrderId"],
    DS.Tables["DTOrderDetail"].Columns["OrderId"])
    c. DS.Relation.Add("DTOrder2DTOrderDetail",
    DS.Tables["DTOrderDetail"].Columns["OrderId"],
    DS.Tables["DTOrder"].Columns["OrderId"])
    d. DS.Relations.Add("DTOrder2DTOrderDetail",
    DS.Tables["DTOrderDetail"].Columns["OrderId"],
    DS.Tables["DTOrder"].Columns["OrderId"])

Answer: b. DS.Relations.Add("DTOrder2DTOrderDetail",<br>DS.Tables["DTOrder"].Columns["OrderId"],<br>DS.Tables["DTOrderDetail"].Columns["OrderId"])
User answers:
2013-06-29 16:17:13
b. DS.Relations.Add("DTOrder2DTOrderDetail",<br>DS.Tables["DTOrder"].Columns["OrderId"],<br>DS.Tables["DTOrderDetail"].Columns["OrderId"])


#83 Question:
You have created an SqlCommand object using "con" as an open connection object:

Dim cmd as New SqlCommand("Select CategoryID, CategoryName FROM Categories", con)

Which of the following methods would be used by you to get data? more..

    a. cmd.ExecuteScalar()
    b. cmd.ExecuteNonQuery()
    c. cmd.ExecuteReader()
    d. cmd.Execute()

Answer: c. cmd.ExecuteReader()
User answers:
2013-06-29 16:21:18
c. cmd.ExecuteReader()


#84 Question:
The data from a DataTable named "Dealers" is retrieved in a DataSet named "ds". Following is the structure of the table as used in the DataTable:

Dealer
--------------------
DealerID -Primary Key
DealerName
DealerAddress
DealerCity
DealerState
DealerPostcode
DealerPhone
DealerEmail

How will you retrieve the phone number for the dealer in the 5 th row of the dataset, if the dataset used is 'typed'? more..

    a. ds.Dealers(4).DealerPhone
    b. ds.Dealers(5).DealerPhone
    c. ds.Tables("Dealers").Rows(4).Item("DealerPhone")
    d. ds.Tables("Dealers").Rows(5).Item("DealerPhone")

Answer: a. ds.Dealers(4).DealerPhone
User answers:
2013-06-29 16:25:31
a. ds.Dealers(4).DealerPhone


#85 Question:
You have a table named 'FirstQTR' and want to create another table 'SecondQTR' which is exactly the same as 'FirstQTR', including DataTable schema and constraints. Which of the following methods fulfills the requirement? more..

    a. Copy
    b. Clone
    c. Duplicate
    d. Equals

Answer: b. Clone
User answers:
2013-06-29 16:32:17
b. Clone


#86 Question:
You are developing a website that has four layers. The layers are: user interface (web pages), business objects, data objects, and the database. You want to pass data from the database to controls on a web form. What should you do? more..

    a. Populate the data objects with data from the database. Populate the controls with values retrieved from the data objects
    b. Populate the business objects with data from the database. Populate the controls with values retrieved from the business objects
    c. Populate the data objects with data from the database. Populate the business objects with data from the data objects. Populate the controls with values retrieved from the business objects
    d. Bind the controls directly to the database

Answer: c. Populate the data objects with data from the database. Populate the business objects with data from the data objects. Populate the controls with values retrieved from the business objects
User answers:
2013-06-29 16:35:45
c. Populate the data objects with data from the database. Populate the business objects with data from the data objects. Populate the controls with values retrieved from the business objects


#87 Question:
Which of the following types of cursors is available with ADO.NET DataReader object? more..

    a. server-side, forward-only, and read-write cursor
    b. server-side, forward-only, and read-only cursor
    c. server-side, backward-only, and read-write cursor
    d. server-side, bidirectional, and read-only cursor

Answer: b. server-side, forward-only, and read-only cursor
User answers:
2013-06-29 16:44:01
b. server-side, forward-only, and read-only cursor


#88 Question:
Which of the following overloaded methods is provided with data table object for sorting and filtering data? more..

    a. Sort
    b. Select
    c. Filter
    d. Find

Answer: b. Select
User answers:
2013-06-29 16:45:49
b. Select

0 comments:

Post a Comment

About