1. 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?
2. ADO.NET is known for disconnected data extraction. Which one does not use the disconnected mechanism while extracting data from the database?
3. 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?'
4. 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?
5. You have created an SqlCommand object as shown below by passing the sql query and the 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?
6. You use a Command object to retrieve employee names from the employee table in the database. Which one will be returned when this command is executed using the ExecuteReader method?
7. You have to retrieve the details of some members from the 'Member' table. The data reader is executed to get the values. Which one helps go through the results?
8. 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?
9. Which one was not among the main design goals behind ADO NET?
10. Which options should you use to copy the edited rows from a dataset called ProductInfo into another dataset called Product Changes?
11. Which command types are provided by an oledb and sql provider?
12. 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?
13. Read the following statements: DataRow oDetailsRow = oDS.Table[''OrderDetails''].NewRow(); oDetailsRow[''ProductId''] = 1; oDetailsRow[''ProductName''] = ''Product 1''; What is wrong with this code?
14. Which one implements IDataReader interface?
15. You have defined a command named 'cmdA' 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?
16. How can you make a data reader close connection automatically?
17. Read the following statements: OleDbDataAdapter oOrderDetailsDataAdapter; OleDbCommandBuilder oOrderDetailsCmdBuilder = New OleDbCommandBuilder(oOrderDetailsDataAdapter); oOrderDetailsDataAdapter.FillSchema(oDS, SchemaType.Source); What is wrong in this code?
18. Which 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
19. Asynchronous execution is supported in ADO.NET 2.0 for ExecuteReader, ExecuteScalar, and ExecuteNonQuery.
20. 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 parameter is set to 40 with version 2.0?
21. Read the following statement: DataTable.Merge (DataTable, Boolean) What is the boolean parameter?
22. You have to update some values in the database. Which method would you execute on a command object named ''cmdUpdate?''
23. 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?
24. 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 one is the most suitable method in the current scenario?
25. 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?
26. Which one is not correct with regard to DataReader and DataSet?
27. 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?
28. 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?
29. Read the following statement: DataTable.Select (String, String) Here, the first parameter accepts a criteria for filtration, what does the second parameter do?
30. Which method ensures optimum use of Connection Pooling?
31. 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?
32. Read the following statements: DataRow oDetailsRow = oDS.Tables[''OrderDetails''].Row(); oDetailsRow[''ProductId''] = 1; oDetailsRow[''ProductName''] = ''Product 1''; What is wrong in this code?
33. Which option is ideally suited for managing database connections?
34. Which one is not associated with the command object in ADO.NET 2.0?
35. Which are used for database connections between SQL Server and ASP.NET?
36. Which statement is incorrect with regard to ADO?
37. Which one is not a member of the CommandType enumeration?
38. Which statement is incorrect with regard to a CommandBuilder object?
39. Which statement with regard to DataSet is correct?
40. 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?
41. 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?
42. Which one is not a valid member of DataAdapter?
43. You must create a stored procedure to retrieve the following details for the given customer: CustomerName, Address, PhoneNumber Which one is an ideal choice to get the result?
44. 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 statement suits for the parameter TotalSale?
45. 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).
46. Which one is not true about CommandType.TableDirect?
47. 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?
48. 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?
49. 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?
50. Which one is capable of returning multiple rows and multiple columns from the database?
51. 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?
52. 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?
53. 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'?
54. How you can you verify whether a dataset has changed?