Upwork ASP.NET with SQL Server Test 2016
98 Answered Test Questions:
1. You are creating an ASP.NET application that is hosted on your company’s Web server. You want to access a database with minimal effort. What you will not do?
Answers:
a. Begin a transaction
a. Create a connection to the database
a. Create a data set using an adapter object
a. Use the data set to display data or to change items in the database
a. Update the database from the data set
a. Close the database connection
a. Check for transaction errors
2. Which of the following are aggregate functions in SQL?
Answers:
a. Avg
a. Select
a. Order By
a. Sum
a. Union
a. Group by
a. Having
3. You create an ASP.NET application for an online insurance site PremiumInsurance. A page named PersonalDetails.aspx has the following Page directive:
1. You are creating an ASP.NET application that is hosted on your company’s Web server. You want to access a database with minimal effort. What you will not do?
Answers:
a. Begin a transaction
a. Create a connection to the database
a. Create a data set using an adapter object
a. Use the data set to display data or to change items in the database
a. Update the database from the data set
a. Close the database connection
a. Check for transaction errors
2. Which of the following are aggregate functions in SQL?
Answers:
a. Avg
a. Select
a. Order By
a. Sum
a. Union
a. Group by
a. Having
3. You create an ASP.NET application for an online insurance site PremiumInsurance. A page named PersonalDetails.aspx has the following Page directive:
<%@ Page Language=”VB” CodeBehind=”PersonalDetails.aspx.vb” AutoEventWireup=”false” inherits=”InsApp.PersonalDet”%>
PersonalDetails.aspx had a TextBox control named MemberID in which the user can enter a Personal MemberID. The HTML code for this control is as follows:
You need to implement a TextChanged event handler for MemberID. You want this event handler to retrieve information about a person by using an XML Web service that charges for each access. The page will then be redisplayed with additional information about the vehicle obtained from the XML Web service.
You are implementing the TextChanged event handler. Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
Answers:
a. In the Page directive for PersonalDetails.aspx, ensure that the AutoEventWireup attributes is set to “true”.
a. In the Page directive for PersonalDetails.aspx, ensure that the EnableViewState attribute is set to “true”.
a. In the MemberID HTML element, ensure that the AutoPostback attribute is set to “false”. Include code for the client-side onserverchange event to submit the Web Form for processing by the server.
a. In the MemberID HTML element, ensure that the AutoPostback attribute is set to “true”. Include code in the TextChanged event handler to query the XML Web service.
4. The simplest query must include at least________ and _________.
Answers:
a. A select clause
a. A where clause
a. A from clause
a. A group by clause
a. A having clause
a. An order by clause
5. You are the software engineer for Premium Corp.. One of the pages in an ASP.NET application contains the following declaration:
You are implementing the TextChanged event handler. Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
Answers:
a. In the Page directive for PersonalDetails.aspx, ensure that the AutoEventWireup attributes is set to “true”.
a. In the Page directive for PersonalDetails.aspx, ensure that the EnableViewState attribute is set to “true”.
a. In the MemberID HTML element, ensure that the AutoPostback attribute is set to “false”. Include code for the client-side onserverchange event to submit the Web Form for processing by the server.
a. In the MemberID HTML element, ensure that the AutoPostback attribute is set to “true”. Include code in the TextChanged event handler to query the XML Web service.
4. The simplest query must include at least________ and _________.
Answers:
a. A select clause
a. A where clause
a. A from clause
a. A group by clause
a. A having clause
a. An order by clause
5. You are the software engineer for Premium Corp.. One of the pages in an ASP.NET application contains the following declaration:
<%@ Register Tagprefix=”WoodySideBankControls” Namespace=”WoodySideBankNameSpace” Assembly=”MyAssembly” %>
The assembly named MyAssembly contains a custom server control named CSC1. Which of the following code samples will properly render CSC1 on the Web page?
Answers:
a.
a.
a.
a.
6. LAST_NAME DEPARTMENT_ID SALARY
ALLEN 10 3000
MILLER 20 1500
King 20 2200
Davis 30 5000
Answers:
a.
a.
a.
a.
6. LAST_NAME DEPARTMENT_ID SALARY
ALLEN 10 3000
MILLER 20 1500
King 20 2200
Davis 30 5000
Which of the following Subqueries will execute without any error?
Answers:
a. SELECT distinct department_id FROM employees Where salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary > (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary < (SELECT AVG(salary) FROM employees GROUP BY department_id);
7. What will happen if you query the emp table as shown below:
Answers:
a. SELECT distinct department_id FROM employees Where salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary > (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);
a. SELECT distinct department_id FROM employees Where salary < (SELECT AVG(salary) FROM employees GROUP BY department_id);
7. What will happen if you query the emp table as shown below:
select empno, DISTINCT ename, Salary from emp;
Answers:
a. EMPNO, unique value of ENAME and then SALARY are displayed
a. EMPNO, unique value ENAME and unique value of SALARY are displayed
a. DISTINCT is not a valid keyword in SQL
a. No values will be displayed because the statement will return an error
8. You are debugging an ASP.NET application for Premium Corp.. Users will use the application to produce reports. Your application contains several Debug.WriteLine statements. Which window in Visual Studio .NET should you use to inspect output from the Debug.WriteLine statements?
Answers:
a. Command
a. Locals
a. Output
a. Breakpoints
9. Examine the query:-
Answers:
a. EMPNO, unique value of ENAME and then SALARY are displayed
a. EMPNO, unique value ENAME and unique value of SALARY are displayed
a. DISTINCT is not a valid keyword in SQL
a. No values will be displayed because the statement will return an error
8. You are debugging an ASP.NET application for Premium Corp.. Users will use the application to produce reports. Your application contains several Debug.WriteLine statements. Which window in Visual Studio .NET should you use to inspect output from the Debug.WriteLine statements?
Answers:
a. Command
a. Locals
a. Output
a. Breakpoints
9. Examine the query:-
select (2/2/4) from tab1;
where tab1 is a table with one row. This would give a result of:
Answers:
a. 4
a. 2
a. 1
a. .5
a. .25
a. 0
a. 8
a. 24
10. Is it possible to insert several rows into a table with a single INSERT statement?
Answers:
a. No
a. Yes
11. 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 ExecuteReader method?
Answers:
a. DataRow
a. DataSet
a. DataTable
a. DataReader
12. Which of the following are the valid methods of the SqlTransaction class?
Answers:
a. Commit
a. Terminate
a. Save
a. Close
a. Rollback
13. Which of the two statements is true?
Answers:
a. 4
a. 2
a. 1
a. .5
a. .25
a. 0
a. 8
a. 24
10. Is it possible to insert several rows into a table with a single INSERT statement?
Answers:
a. No
a. Yes
11. 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 ExecuteReader method?
Answers:
a. DataRow
a. DataSet
a. DataTable
a. DataReader
12. Which of the following are the valid methods of the SqlTransaction class?
Answers:
a. Commit
a. Terminate
a. Save
a. Close
a. Rollback
13. Which of the two statements is true?
(a)MSIL code is platform independent
(b)CLR is platform dependent
Answers:
a. Only (a) is true, (b) is false
a. Only (b) is true, (a) is false
a. Both (a) and (b) are true
a. Both (a) and (b) are false
14. Consider the following two statements relating to ASP.NET and choose the most appropriate option:
(b)CLR is platform dependent
Answers:
a. Only (a) is true, (b) is false
a. Only (b) is true, (a) is false
a. Both (a) and (b) are true
a. Both (a) and (b) are false
14. Consider the following two statements relating to ASP.NET and choose the most appropriate option:
Statement 1: Value types are allocated on a stack
Statement 2: Reference types are allocated on a managed CLR Heap
Answers:
a. Statement 1 is true and statement 2 is false
a. Statement 2 is true and statement 1 is false
a. Both statements 1 and 2 are true
a. Both statements 1 and 2 are false
15. You are debugging a Visual Basic.NET application. You add a variable to the watch window. When Visual Basic enters break mode, the Value of the expression variable is “”. What is the most likely cause of the problem?
Answers:
a. The variable is not currently in scope.
a. The variable has been defined as public.
a. The variable has been defined as private.
a. The variable has not been defined in this project.
16. Check the following code:
Statement 2: Reference types are allocated on a managed CLR Heap
Answers:
a. Statement 1 is true and statement 2 is false
a. Statement 2 is true and statement 1 is false
a. Both statements 1 and 2 are true
a. Both statements 1 and 2 are false
15. You are debugging a Visual Basic.NET application. You add a variable to the watch window. When Visual Basic enters break mode, the Value of the expression variable is “”. What is the most likely cause of the problem?
Answers:
a. The variable is not currently in scope.
a. The variable has been defined as public.
a. The variable has been defined as private.
a. The variable has not been defined in this project.
16. Check the following code:
Public Shared Sub UpdateData(ByVal sql As String,ByVal connectionString As String, ByVal dataTable As DataTable)
Dim da As New OleDb.OleDbDataAdapter()
Dim cnn As New OleDb.OleDbConnection(connectionString)
dataTable.AcceptChanges()
da.UpdateCommand.CommandText = sql
da.UpdateCommand.Connection = cnn
da.Update(dataTable)
da.Dispose()
End Sub
Dim cnn As New OleDb.OleDbConnection(connectionString)
dataTable.AcceptChanges()
da.UpdateCommand.CommandText = sql
da.UpdateCommand.Connection = cnn
da.Update(dataTable)
da.Dispose()
End Sub
You are creating an ASP.NET application that will be used by companies to quickly create information portals customized to their business. Your application stored commonly used text strings in application variables for use by the page in your application. You need your application to initialize these text strings only when the first user accesses the application. What should you do?
Answers:
a. Add code to the Application_OnStart event handler in the Global.asax file to set the values of the text strings.
a. Add code to the Application_BeginRequest event handler in the Global.asax file to set the values of the text strings.
a. Add code to the Session_OnStart event handler in the Global.asax file to set the values of the text strings.
a. Include code in the Page.Load event handler for the default application page that sets the values if the text strings when the IsPostback property of the Page object is False.
a. Include code in the Page.Load event handler for the default application page that sets the values of the text strings when the IsNewSession property of the Session object is set to True.
17. Examine the code given below:
Answers:
a. Add code to the Application_OnStart event handler in the Global.asax file to set the values of the text strings.
a. Add code to the Application_BeginRequest event handler in the Global.asax file to set the values of the text strings.
a. Add code to the Session_OnStart event handler in the Global.asax file to set the values of the text strings.
a. Include code in the Page.Load event handler for the default application page that sets the values if the text strings when the IsPostback property of the Page object is False.
a. Include code in the Page.Load event handler for the default application page that sets the values of the text strings when the IsNewSession property of the Session object is set to True.
17. Examine the code given below:
SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000
Which of the following statements is correct with regard to this code?
Answers:
a. It returns employees whose salary is 50% more than $23,000
a. It returns employees who have 50% commission rate or salary greater than $23,000
a. It returns employees whose salary is 50% less than $23,000
a. None of the above
18. Evaluate the following SQL statement:
Answers:
a. It returns employees whose salary is 50% more than $23,000
a. It returns employees who have 50% commission rate or salary greater than $23,000
a. It returns employees whose salary is 50% less than $23,000
a. None of the above
18. Evaluate the following SQL statement:
SELECT e.employee_id,( (.15* e.salary) + (.5 * e.commission_pct) + (s.sales_amount * (.35 * e.bonus))) AS CALC_VALUE FROM employees e, sales s WHERE e.employee_id = s.emp_id;�
What will happen if all the parentheses are removed from the calculation?
Answers:
a. The value displayed in the CALC_VALUE column will be lower
a. The value displayed in the CALC_VALUE column will be higher
a. There will be no difference in the value displayed in the CALC_VALUE column
a. An error will be reported
19. You are creating an ASP.NET page for Premium Consultants. You create a GridView control that displays past purchases made by the user. The GridView control is populated from an existing database when the page is created. The page contains TextBox controls that allow users to update their personal information, such as address and telephone number. You need to ensure that the page is refreshed as quickly as possible when users update their contact information.
What should you do?
Answers:
a. Set the Enabled property of the GridView control to false.
a. Set the EnableViewState property of the GridView to false.
a. Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is false.
a. Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is true.
20. Sam is developing an application that enables the users to perform read and write operations on text files. He uses structured exception handling to handle the errors. He writes the code for closing all the files that were opened in the Finally block. Which of the following is true regarding the Finally block?
Answers:
a. Finally block will be executed only if an error occurs
a. Finally block is executed after Catch block when no error occurs
a. Finally block is executed after Try block regardless of whether an error occurs
a. Finally block is executed only when no error occurs
21. You are creating an ASP.NET application that will record each customer’s entry. It is possible that thousands of entries could be posted at any given time. Your application will be hosted on twenty Web servers. As customers enter information into your application, maintaining state information will be important. This information should be stored securely and should be capable of being restored in the event that a Web server is restarted. Customers will enter data into three separate pages in your application. Which of the following methods of storing state information would best suit the situation?
Answers:
a. View State
a. Hidden fields
a. State Server
a. Application state
a. SQL Server
22. You are creating an ASP.net application to enter timesheet data intuitively. Users will enter data using a DataGrid. You have added a button column to your DataGrid. The button column uses a custom button to allow users to initiate some calculations on the data in the grid. Which event does the DataGrid control raise when the custom button is clicked?
Answers:
a. EditCommand
a. OnClick
a. ButtonClicked
a. ItemCommand
23. Which line of code should you use to copy the edited rows from dataset productInfo into another dataset productChanges?
Answers:
a. productChanges = productInfo.GetChanges(DataRowState.Detached)
a. productChanges = productInfo.GetChanges()
a. productChanges.Merge(productInfo, true)
a. productChanges.Merge(productInfo, false)
24. You are maintaining data for its products in the Products table, and you want to see those products, which are 50 items that is currentStock or more than 50 but less than the minimum stock limit of items. The structure of the Products table is:
Answers:
a. The value displayed in the CALC_VALUE column will be lower
a. The value displayed in the CALC_VALUE column will be higher
a. There will be no difference in the value displayed in the CALC_VALUE column
a. An error will be reported
19. You are creating an ASP.NET page for Premium Consultants. You create a GridView control that displays past purchases made by the user. The GridView control is populated from an existing database when the page is created. The page contains TextBox controls that allow users to update their personal information, such as address and telephone number. You need to ensure that the page is refreshed as quickly as possible when users update their contact information.
What should you do?
Answers:
a. Set the Enabled property of the GridView control to false.
a. Set the EnableViewState property of the GridView to false.
a. Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is false.
a. Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is true.
20. Sam is developing an application that enables the users to perform read and write operations on text files. He uses structured exception handling to handle the errors. He writes the code for closing all the files that were opened in the Finally block. Which of the following is true regarding the Finally block?
Answers:
a. Finally block will be executed only if an error occurs
a. Finally block is executed after Catch block when no error occurs
a. Finally block is executed after Try block regardless of whether an error occurs
a. Finally block is executed only when no error occurs
21. You are creating an ASP.NET application that will record each customer’s entry. It is possible that thousands of entries could be posted at any given time. Your application will be hosted on twenty Web servers. As customers enter information into your application, maintaining state information will be important. This information should be stored securely and should be capable of being restored in the event that a Web server is restarted. Customers will enter data into three separate pages in your application. Which of the following methods of storing state information would best suit the situation?
Answers:
a. View State
a. Hidden fields
a. State Server
a. Application state
a. SQL Server
22. You are creating an ASP.net application to enter timesheet data intuitively. Users will enter data using a DataGrid. You have added a button column to your DataGrid. The button column uses a custom button to allow users to initiate some calculations on the data in the grid. Which event does the DataGrid control raise when the custom button is clicked?
Answers:
a. EditCommand
a. OnClick
a. ButtonClicked
a. ItemCommand
23. Which line of code should you use to copy the edited rows from dataset productInfo into another dataset productChanges?
Answers:
a. productChanges = productInfo.GetChanges(DataRowState.Detached)
a. productChanges = productInfo.GetChanges()
a. productChanges.Merge(productInfo, true)
a. productChanges.Merge(productInfo, false)
24. You are maintaining data for its products in the Products table, and you want to see those products, which are 50 items that is currentStock or more than 50 but less than the minimum stock limit of items. The structure of the Products table is:
ProductID
ProductName
CurrentStock
MinimumStock
ProductName
CurrentStock
MinimumStock
Two possible queries are:
(a)select * from products where currentStock > MinimumStock + 50
(b)select * from products where currentStock – 50 > MinimumStock
(b)select * from products where currentStock – 50 > MinimumStock
Choose the appropriate option with regard to the above queries.
Answers:
a. (a) is correct
a. (b) is correct
a. (a) and (b) both are correct
a. (a) and (b) both are incorrect
25. How you will generate a report with minimum network traffic?
Answers:
a. Use Microsoft SQL Server indexes to optimize the data calculations
a. Implement the calculations in a business layer class
a. Implement the calculations in a data layer class
a. Use Microsoft SQL Server stored procedures for the data calculations
26. You are creating an ASP.NET Web site for your company. The Web site will use both Microsoft(R) .NET Framework server controls and ActiveX controls. You want to use Microsoft Visual Studio(R) .NET to create a Setup and Deployment project to package the ActiveX controls. Which project type should you create?
Answers:
a. Cab
a. Merge Module
a. Web Setup
a. Setup
27. In SQL Server, you should avoid the use of cursors because:
Answers:
a. They are very difficult to implement
a. Programs with cursors take more time to run, hence performance degrades
a. Programs with cursors are more lengthy, hence they consume more space/memory
a. No, you must maximize the use of cursors because they improve performance
28. Which one of the following correctly selects rows from the table myTable that have null in column column1?
Answers:
a. SELECT * FROM myTable WHERE column1 is null
a. SELECT * FROM myTable WHERE column1 = null
a. SELECT * FROM myTable WHERE column1 EQUALS null
a. SELECT * FROM myTable WHERE column1 NOT null
a. SELECT * FROM myTable WHERE column1 CONTAINS null
29. Consider the following queries:
Answers:
a. (a) is correct
a. (b) is correct
a. (a) and (b) both are correct
a. (a) and (b) both are incorrect
25. How you will generate a report with minimum network traffic?
Answers:
a. Use Microsoft SQL Server indexes to optimize the data calculations
a. Implement the calculations in a business layer class
a. Implement the calculations in a data layer class
a. Use Microsoft SQL Server stored procedures for the data calculations
26. You are creating an ASP.NET Web site for your company. The Web site will use both Microsoft(R) .NET Framework server controls and ActiveX controls. You want to use Microsoft Visual Studio(R) .NET to create a Setup and Deployment project to package the ActiveX controls. Which project type should you create?
Answers:
a. Cab
a. Merge Module
a. Web Setup
a. Setup
27. In SQL Server, you should avoid the use of cursors because:
Answers:
a. They are very difficult to implement
a. Programs with cursors take more time to run, hence performance degrades
a. Programs with cursors are more lengthy, hence they consume more space/memory
a. No, you must maximize the use of cursors because they improve performance
28. Which one of the following correctly selects rows from the table myTable that have null in column column1?
Answers:
a. SELECT * FROM myTable WHERE column1 is null
a. SELECT * FROM myTable WHERE column1 = null
a. SELECT * FROM myTable WHERE column1 EQUALS null
a. SELECT * FROM myTable WHERE column1 NOT null
a. SELECT * FROM myTable WHERE column1 CONTAINS null
29. Consider the following queries:
1. select * from employee where department LIKE ‘[^F-M]%’;
2. select * from employee where department = ‘[^F-M]%’;
2. select * from employee where department = ‘[^F-M]%’;
Select the correct option:
Answers:
a. Query 2 will return an error
a. Both the queries will return the same set of records
a. Query 2 is perfectly correct
a. Query 2 would return one record less than Query 1
30. You need to install an online parcel tracking application and its supporting assemblies so that the application and its assemblies can be uninstalled using the Add/Remove Programs Control Panel applet. What should you do?
Answers:
a. Use a Web installation package for the Web application. Use the Global Application Cache (GAc)utility, GACUtil.exe, to install the supporting assemblies into the GAC.
a. Use Xcopy deployment for the Web application and its supporting assemblies.
a. Use Xcopy deployment to deploy the Web application. Use merge modules to install the supporting assemblies.
a. Use a Web installation package to install the Web application and the supporting assemblies.
31. Which of the following is not a valid SQL operator?
Answers:
a. Between..and..
a. Like
a. In
a. Is null
a. Having
a. Not in
a. All of the above are valid.
32. You create an ASP.NET page that allows a user to enter a requested delivery date in a TextBox control named txtDelDate. The date must be no earlier than two business days after the order date, and no later that 60 business days after the order date. You add a CustomValidator control to your page. In the Properties window, you set the ControlToValidate property to txtDelDate. You need to ensure that the date entered in the txtDelDate TextBox control falls within the acceptable range of values. In addition, you need to minimize the number of round trips to the server. What should you do?
Answers:
a. Set the AutoPostBack property of txtDelDate to False. Write code in the ServerValidate event handler to validate the date.
a. Set the AutoPostBack property of txtDelDate to True. Write code in the ServerValidate event handler to validate the date.
a. Set the AutoPostBack property of txtDelDate to False. Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
a. Set the AutoPostBack property of txtDelDate to True. Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
33. In ASP.NET, the exception handling should be used:
Answers:
a. to signal the occurrence of unusual or unanticipated program events
a. to redirect the program’s normal flow of control
a. in cases of potential logic or user input errors
a. in case of overflow of an array boundary
34. How can you view the results of Trace.Write() statements?
Answers:
a. By enabling page tracing
a. By enabling application tracing
a. By enabling server tracing
a. By looking up the system.log file
35. Which of the following are false for ASP.NET events?
Answers:
a. Events are specialized forms of delegates
a. Events are used to support the callback event notification model
a. The signature of any event handler is fixed
a. All of the above are true
36. What will happen if the Server configuration file and the Application configuration file have different values for session state?
Answers:
a. The Server configuration will always override the Application configuration
a. The Application configuration will always override the Server configuration
a. The Server configuration will override the Application configuration if allowOverride is set to “false” in the settings in the Server configuration file
a. The Application configuration will override the Server configuration if allowOverride is set to “false” in the settings in the Server configuration file
37. A company has the following departments:
Answers:
a. Query 2 will return an error
a. Both the queries will return the same set of records
a. Query 2 is perfectly correct
a. Query 2 would return one record less than Query 1
30. You need to install an online parcel tracking application and its supporting assemblies so that the application and its assemblies can be uninstalled using the Add/Remove Programs Control Panel applet. What should you do?
Answers:
a. Use a Web installation package for the Web application. Use the Global Application Cache (GAc)utility, GACUtil.exe, to install the supporting assemblies into the GAC.
a. Use Xcopy deployment for the Web application and its supporting assemblies.
a. Use Xcopy deployment to deploy the Web application. Use merge modules to install the supporting assemblies.
a. Use a Web installation package to install the Web application and the supporting assemblies.
31. Which of the following is not a valid SQL operator?
Answers:
a. Between..and..
a. Like
a. In
a. Is null
a. Having
a. Not in
a. All of the above are valid.
32. You create an ASP.NET page that allows a user to enter a requested delivery date in a TextBox control named txtDelDate. The date must be no earlier than two business days after the order date, and no later that 60 business days after the order date. You add a CustomValidator control to your page. In the Properties window, you set the ControlToValidate property to txtDelDate. You need to ensure that the date entered in the txtDelDate TextBox control falls within the acceptable range of values. In addition, you need to minimize the number of round trips to the server. What should you do?
Answers:
a. Set the AutoPostBack property of txtDelDate to False. Write code in the ServerValidate event handler to validate the date.
a. Set the AutoPostBack property of txtDelDate to True. Write code in the ServerValidate event handler to validate the date.
a. Set the AutoPostBack property of txtDelDate to False. Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
a. Set the AutoPostBack property of txtDelDate to True. Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
33. In ASP.NET, the exception handling should be used:
Answers:
a. to signal the occurrence of unusual or unanticipated program events
a. to redirect the program’s normal flow of control
a. in cases of potential logic or user input errors
a. in case of overflow of an array boundary
34. How can you view the results of Trace.Write() statements?
Answers:
a. By enabling page tracing
a. By enabling application tracing
a. By enabling server tracing
a. By looking up the system.log file
35. Which of the following are false for ASP.NET events?
Answers:
a. Events are specialized forms of delegates
a. Events are used to support the callback event notification model
a. The signature of any event handler is fixed
a. All of the above are true
36. What will happen if the Server configuration file and the Application configuration file have different values for session state?
Answers:
a. The Server configuration will always override the Application configuration
a. The Application configuration will always override the Server configuration
a. The Server configuration will override the Application configuration if allowOverride is set to “false” in the settings in the Server configuration file
a. The Application configuration will override the Server configuration if allowOverride is set to “false” in the settings in the Server configuration file
37. A company has the following departments:
Marketing, Designing, production, Packing
What will be the result of the following query?
select * from table where department < ‘marketing’;
Answers:
a. The query will return “Designing, Packing”
a. The query will return “Designing, production, Packing”
a. The query will return “packing”
a. Strings cannot be compared using < operator
a. The query will return “Designing”
38. Your company, StoreIt Inc has stored the text of several journals in a Microsoft SQL Server 7.0 database. Each sentence is stored in a separate record so that the text can be retrieved with the finest granularity. Several of these works are many thousands of printed pages in length. You are building a Web application that will allow registered users to retrieve data from these volumes. When a user of your Web application requests large amounts of text, your application must return it in the most efficient manner possible. How should you build the large String object that is required to provide the most efficient response to the user?
Answers:
a. Use a RichTextBox object to hold the data as it is being concatenated.
a. Use the Append method of the String class.
a. Use the String class and the & operator.
a. Use the StringBuilder class.
39. The sales database contains a customer table and an order table. For each order there is one and only one customer, and for each customer there can be zero or more orders. How should primary and foreign key fields be placed into the design of this database?
Answers:
a. A primary key should be created for the customer_id field in the customer table and also for the customer_id field in the order table
a. A primary key should be created for the order_id field in the customer table and also for the customer_id field in the order table
a. A primary key should be created for the customer_id field in the customer table and a foreign key should be created for the customer_id field in the order table
a. A primary key should be created for the customer_id field in the customer table and a foreign key should be created for the order_id field in the order table
a. None of these
40. 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”?
Answers:
a. MyAdapter.Fill(MyDataSet,”Customer”)
a. MyAdapter.Fill(“MyDataSet”,Customer)
a. MyAdapter.Fill(MyDataSet)
a. MyAdapter.Fill(“MyDataSet”)
41. What is the order of precedence among the following operators?
Answers:
a. The query will return “Designing, Packing”
a. The query will return “Designing, production, Packing”
a. The query will return “packing”
a. Strings cannot be compared using < operator
a. The query will return “Designing”
38. Your company, StoreIt Inc has stored the text of several journals in a Microsoft SQL Server 7.0 database. Each sentence is stored in a separate record so that the text can be retrieved with the finest granularity. Several of these works are many thousands of printed pages in length. You are building a Web application that will allow registered users to retrieve data from these volumes. When a user of your Web application requests large amounts of text, your application must return it in the most efficient manner possible. How should you build the large String object that is required to provide the most efficient response to the user?
Answers:
a. Use a RichTextBox object to hold the data as it is being concatenated.
a. Use the Append method of the String class.
a. Use the String class and the & operator.
a. Use the StringBuilder class.
39. The sales database contains a customer table and an order table. For each order there is one and only one customer, and for each customer there can be zero or more orders. How should primary and foreign key fields be placed into the design of this database?
Answers:
a. A primary key should be created for the customer_id field in the customer table and also for the customer_id field in the order table
a. A primary key should be created for the order_id field in the customer table and also for the customer_id field in the order table
a. A primary key should be created for the customer_id field in the customer table and a foreign key should be created for the customer_id field in the order table
a. A primary key should be created for the customer_id field in the customer table and a foreign key should be created for the order_id field in the order table
a. None of these
40. 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”?
Answers:
a. MyAdapter.Fill(MyDataSet,”Customer”)
a. MyAdapter.Fill(“MyDataSet”,Customer)
a. MyAdapter.Fill(MyDataSet)
a. MyAdapter.Fill(“MyDataSet”)
41. What is the order of precedence among the following operators?
1 IN
2 NOT
3 AND
4 OR
Answers:
a. 1,2,3,4
a. 2,3,4,1
a. 1,2,4,3
a. 1,4,3,2
a. 4,3,2,1
a. 4,1,2,3
a. 4,2,1,3
a. 3,2,1,4
42. Which query will display data from the Pers table relating to Analysts, clerks and Salesmen who joined between 1/1/2005 and 1/2/2005?
Answers:
a. select * from Pers where joining_date from ‘1/1/2005’ to ‘1/2/2005’, job= ‘Analyst’ or ‘clerk’ or ‘salesman’
a. select * from Pers where joining_date between ‘1/1/2005’ to ‘1/2/2005’, job= ‘Analyst’ or job= ‘clerk’ or job= ‘salesman’
a. select * from Pers where joining_date between ‘1/1/2005’ and ‘1/2/2005’ and (job= ‘Analyst’ or ‘clerk’ or ‘salesman’)
a. None of the above
43. What is the correct order of clauses in the select statement?
2 NOT
3 AND
4 OR
Answers:
a. 1,2,3,4
a. 2,3,4,1
a. 1,2,4,3
a. 1,4,3,2
a. 4,3,2,1
a. 4,1,2,3
a. 4,2,1,3
a. 3,2,1,4
42. Which query will display data from the Pers table relating to Analysts, clerks and Salesmen who joined between 1/1/2005 and 1/2/2005?
Answers:
a. select * from Pers where joining_date from ‘1/1/2005’ to ‘1/2/2005’, job= ‘Analyst’ or ‘clerk’ or ‘salesman’
a. select * from Pers where joining_date between ‘1/1/2005’ to ‘1/2/2005’, job= ‘Analyst’ or job= ‘clerk’ or job= ‘salesman’
a. select * from Pers where joining_date between ‘1/1/2005’ and ‘1/2/2005’ and (job= ‘Analyst’ or ‘clerk’ or ‘salesman’)
a. None of the above
43. What is the correct order of clauses in the select statement?
1 select
2 order by
3 where
4 having
5 group by
Answers:
a. 1,2,3,4,5
a. 1,3,5,4,2
a. 1,3,5,2,4
a. 1,3,2,5,4
a. 1,3,2,4,5
a. 1,5,2,3,4
a. 1,4,2,3,5
a. 1,4,3,2,5
44. Which of the following queries is valid?
Answers:
a. Select * from students where marks > avg(marks);
a. Select * from students order by marks where subject = ‘SQL’;
a. Select * from students having subject =’SQL’;
a. Select name from students group by subject, name;
a. Select group(*) from students;
a. Select name,avg(marks) from students;
a. None of the above
45. Which of the following is the syntax for creating an Index?
Answers:
a. CREATE [UNIQUE] INDEX index_name OF tbl_name (index_columns)
a. CREATE [UNIQUE] INDEX OF tbl_name (index_columns)
a. CREATE [UNIQUE] INDEX ON tbl_name (index_columns)
a. CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns)
46. You have developed a custom server control and have compiled it into a file named FirstReport.dll.
The code is displayed below:
2 order by
3 where
4 having
5 group by
Answers:
a. 1,2,3,4,5
a. 1,3,5,4,2
a. 1,3,5,2,4
a. 1,3,2,5,4
a. 1,3,2,4,5
a. 1,5,2,3,4
a. 1,4,2,3,5
a. 1,4,3,2,5
44. Which of the following queries is valid?
Answers:
a. Select * from students where marks > avg(marks);
a. Select * from students order by marks where subject = ‘SQL’;
a. Select * from students having subject =’SQL’;
a. Select name from students group by subject, name;
a. Select group(*) from students;
a. Select name,avg(marks) from students;
a. None of the above
45. Which of the following is the syntax for creating an Index?
Answers:
a. CREATE [UNIQUE] INDEX index_name OF tbl_name (index_columns)
a. CREATE [UNIQUE] INDEX OF tbl_name (index_columns)
a. CREATE [UNIQUE] INDEX ON tbl_name (index_columns)
a. CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns)
46. You have developed a custom server control and have compiled it into a file named FirstReport.dll.
The code is displayed below:
<%@ Register TagPrefix=” CertKing Tag” Namespace=”ReportNS” Assembly=” CertKing Report” %>
You want to set the PageNumber property of the control to 77.
Which of the following lines of code should you include in your Web Form?
Answers:
a. < CertKing Tag:ReportNS PageNumber=”77″ runat=”server” />
a.
a. < CertKing Tag:myReport PageNumber=”77″ runat=”server” />
a. <% Control TagName=”myReport” src=”rptctrl” runat=”server” %>
47. You are creating an ASP.NET page for your company’s Web site. Customers will use the ASP.NET page to enter payment information. You add a DropDownList control named oPaymentTypeList that enables customers to select a type of credit card and bank accounts. You need to ensure that customers select a credit card type. You want a default value of Select to be displayed in the oPaymentTypeList control. You want the page validation to fail if a customer does not select a payment type from the list. What should you do?
Answers:
a. Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the InitialValue property of the RequiredFieldValidator control to Select.
a. Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
a. Add a CustomValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
a. Add a RegularExpressionValidator control and set its ControlToValidate property to oPaymentTypeList. Set the ValidateExpression property of the RegularExpressionValidator control to Select.
48. How can you change “Hansen” into “Nilsen” in the LastName column in the Persons Table?
Answers:
a. UPDATE Persons SET LastName = ‘Nilsen’ WHERE LastName = ‘Hansen’
a. UPDATE Persons SET LastName = ‘Hansen’ INTO LastName = ‘Nilsen’
a. SAVE Persons SET LastName = ‘Nilsen’ WHERE LastName = ‘Hansen’
a. SAVE Persons SET LastName = ‘Hansen’ INTO LastName = ‘Nilsen’
49. You create an ASP.NET application for ABC Corporation. The project manager requires a standard appearance for all Web applications. Standards are expected to change periodically. You need to enforce these standards and reduce maintenance time. What would you do?
Answers:
a. Create a Microsoft Visual Studio .NET Enterprise template
a. Create a sample HTML page
a. Create a sample ASP.NET Web form
a. Create a cascading style sheet
50. Which operator will be evaluated first in the following statement:
Answers:
a. < CertKing Tag:ReportNS PageNumber=”77″ runat=”server” />
a.
a. < CertKing Tag:myReport PageNumber=”77″ runat=”server” />
a. <% Control TagName=”myReport” src=”rptctrl” runat=”server” %>
47. You are creating an ASP.NET page for your company’s Web site. Customers will use the ASP.NET page to enter payment information. You add a DropDownList control named oPaymentTypeList that enables customers to select a type of credit card and bank accounts. You need to ensure that customers select a credit card type. You want a default value of Select to be displayed in the oPaymentTypeList control. You want the page validation to fail if a customer does not select a payment type from the list. What should you do?
Answers:
a. Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the InitialValue property of the RequiredFieldValidator control to Select.
a. Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
a. Add a CustomValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
a. Add a RegularExpressionValidator control and set its ControlToValidate property to oPaymentTypeList. Set the ValidateExpression property of the RegularExpressionValidator control to Select.
48. How can you change “Hansen” into “Nilsen” in the LastName column in the Persons Table?
Answers:
a. UPDATE Persons SET LastName = ‘Nilsen’ WHERE LastName = ‘Hansen’
a. UPDATE Persons SET LastName = ‘Hansen’ INTO LastName = ‘Nilsen’
a. SAVE Persons SET LastName = ‘Nilsen’ WHERE LastName = ‘Hansen’
a. SAVE Persons SET LastName = ‘Hansen’ INTO LastName = ‘Nilsen’
49. You create an ASP.NET application for ABC Corporation. The project manager requires a standard appearance for all Web applications. Standards are expected to change periodically. You need to enforce these standards and reduce maintenance time. What would you do?
Answers:
a. Create a Microsoft Visual Studio .NET Enterprise template
a. Create a sample HTML page
a. Create a sample ASP.NET Web form
a. Create a cascading style sheet
50. Which operator will be evaluated first in the following statement:
select (age + 3 * 4 / 2 – 8) from emp
Answers:
a. +
a. –
a. /
a. *
51. When you make some changes to the configuration file, do you need to stop and start IIS to apply the new settings?
Answers:
a. Yes
a. No
52. What is wrong with the following query:
Answers:
a. +
a. –
a. /
a. *
51. When you make some changes to the configuration file, do you need to stop and start IIS to apply the new settings?
Answers:
a. Yes
a. No
52. What is wrong with the following query:
select * from Orders where OrderID = (select OrderID from OrderItems where ItemQty > 50)
Answers:
a. In the sub query, ‘*’ should be used instead of ‘OrderID’
a. The sub query can return more than one row, so, ‘=’ should be replaced with ‘in’
a. The sub query should not be in parenthesis
a. None of the above
53. Which of the following is the default configuration file for each application in ASP.NET?
Answers:
a. config.web
a. web.config
a. sys.config
a. config.sys
54. In which sequence are queries and sub-queries executed by the SQL Engine?
Answers:
a. primary query -> sub query -> sub sub query and so on
a. sub sub query -> sub query -> prime query
a. the whole query is interpreted at one time
a. there is no fixed sequence of interpretation, the query parser takes a decision on the fly
55. You are developing a website that has four layers. The layers are user interface (web pages), business objects, data objects, and database. You want to pass data from the database to controls on a web form. What should you do?
Answers:
a. Populate the data objects with data from the database. Populate the controls with values retrieved from the data objects.
a. Populate the business objects with data from the database. Populate the controls with values retrieved from the business objects.
a. 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
a. Bind the controls directly to the database.
56. Consider the following two tables:
Answers:
a. In the sub query, ‘*’ should be used instead of ‘OrderID’
a. The sub query can return more than one row, so, ‘=’ should be replaced with ‘in’
a. The sub query should not be in parenthesis
a. None of the above
53. Which of the following is the default configuration file for each application in ASP.NET?
Answers:
a. config.web
a. web.config
a. sys.config
a. config.sys
54. In which sequence are queries and sub-queries executed by the SQL Engine?
Answers:
a. primary query -> sub query -> sub sub query and so on
a. sub sub query -> sub query -> prime query
a. the whole query is interpreted at one time
a. there is no fixed sequence of interpretation, the query parser takes a decision on the fly
55. You are developing a website that has four layers. The layers are user interface (web pages), business objects, data objects, and database. You want to pass data from the database to controls on a web form. What should you do?
Answers:
a. Populate the data objects with data from the database. Populate the controls with values retrieved from the data objects.
a. Populate the business objects with data from the database. Populate the controls with values retrieved from the business objects.
a. 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
a. Bind the controls directly to the database.
56. Consider the following two tables:
1. customers( customer_id, customer_name)
2. branch ( branch_id, branch_name )
2. branch ( branch_id, branch_name )
What will be the output if the following query is executed:
Select *, branch_name from customers,branch
Answers:
a. It will return the fields customer_id, customer_name, branch_name
a. It will return the fields customer_id, customer_name, branch_id, branch_name
a. It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name
a. It will return an empty set since the two tables do not have any common field name
a. It will return an error since * is used alone for one table only
57. Which of the following are not true in ASP.NET?
Answers:
a. A try block can have more than one catch blocks
a. Every try block must have a catch block
a. Every try block must have a finally block
a. All exception classes are to be derived from System.Exception
58. XYZ is creating an e-commerce site for PremiumBoutique. The site is distributed across multiple servers in a Web farm. Users will be able to navigate through the pages of the site and select products for purchase. XYZ wants to use a DataSet object to save their selections. Users will be able to view their selections at any time by clicking a Shopping Cart link. XYZ wants to ensure that each user’s shopping cart DataSet object is saved between requests when the user is making purchases on the site. How can this requirement be implement?
Answers:
a. Create a StateBag object. Use the StateBag object to store the DataSet object in the page’s ViewState property
a. Use the HttpSessionState object returned by the Session property of the page to store the DataSet object. Use the Web.config file to configure an out-of-process session route
a. Use the Cache object returned by the page’s Cache property to store a DataSet object for each user. Use an HttpCachePolicy object to set a timeout period for the cached data
a. Use the Session_Start event to create an Application variable of type DataSet for each session. Store the DataSet object in the Application variable
59. In ASP.NET, which of the following is not an event of the Page class?
Answers:
a. Init
a. Load
a. Error
a. Abort
60. Is the FROM clause necessary in every SELECT statement?
Answers:
a. Yes
a. No
61. Which DLL is responsible for processing the page requests running on the server?
Answers:
a. Internet Server Application Programming Interface
a. Internet Information Server Program
a. Webserver interface
a. IIS Application
62. What is the total no. of events in Global.asax file in Asp.NET?
Answers:
a. 20
a. 25
a. 19
a. 32
63. Which of the following datatypes is not supported by SQL-Server?
Answers:
a. Character
a. Binary
a. Logical
a. Date
a. Numeric
a. All are supported
64. It is time for the annual sales awards at your company. The awards include certificates awarded for the five sales of the highest sale amounts. You need to produce a list of the five highest revenue transactions from the Orders table in the Sales database. The Orders table is defined as follows:
Answers:
a. It will return the fields customer_id, customer_name, branch_name
a. It will return the fields customer_id, customer_name, branch_id, branch_name
a. It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name
a. It will return an empty set since the two tables do not have any common field name
a. It will return an error since * is used alone for one table only
57. Which of the following are not true in ASP.NET?
Answers:
a. A try block can have more than one catch blocks
a. Every try block must have a catch block
a. Every try block must have a finally block
a. All exception classes are to be derived from System.Exception
58. XYZ is creating an e-commerce site for PremiumBoutique. The site is distributed across multiple servers in a Web farm. Users will be able to navigate through the pages of the site and select products for purchase. XYZ wants to use a DataSet object to save their selections. Users will be able to view their selections at any time by clicking a Shopping Cart link. XYZ wants to ensure that each user’s shopping cart DataSet object is saved between requests when the user is making purchases on the site. How can this requirement be implement?
Answers:
a. Create a StateBag object. Use the StateBag object to store the DataSet object in the page’s ViewState property
a. Use the HttpSessionState object returned by the Session property of the page to store the DataSet object. Use the Web.config file to configure an out-of-process session route
a. Use the Cache object returned by the page’s Cache property to store a DataSet object for each user. Use an HttpCachePolicy object to set a timeout period for the cached data
a. Use the Session_Start event to create an Application variable of type DataSet for each session. Store the DataSet object in the Application variable
59. In ASP.NET, which of the following is not an event of the Page class?
Answers:
a. Init
a. Load
a. Error
a. Abort
60. Is the FROM clause necessary in every SELECT statement?
Answers:
a. Yes
a. No
61. Which DLL is responsible for processing the page requests running on the server?
Answers:
a. Internet Server Application Programming Interface
a. Internet Information Server Program
a. Webserver interface
a. IIS Application
62. What is the total no. of events in Global.asax file in Asp.NET?
Answers:
a. 20
a. 25
a. 19
a. 32
63. Which of the following datatypes is not supported by SQL-Server?
Answers:
a. Character
a. Binary
a. Logical
a. Date
a. Numeric
a. All are supported
64. It is time for the annual sales awards at your company. The awards include certificates awarded for the five sales of the highest sale amounts. You need to produce a list of the five highest revenue transactions from the Orders table in the Sales database. The Orders table is defined as follows:
CREATE TABLE Orders (
OrderID Int IDENTITY NOT NULL,
SalesPersonID Int NOT NULL,
RegionID Int NOT NULL,
OrderDate Datetime NOT NULL,
OrderAmount Int NOT NULL )
OrderID Int IDENTITY NOT NULL,
SalesPersonID Int NOT NULL,
RegionID Int NOT NULL,
OrderDate Datetime NOT NULL,
OrderAmount Int NOT NULL )
Which statement will produce the report correctly?
Answers:
a. SELECT TOP 5 OrderAmount, SalesPersonID FROM orders
a. SELECT TOP 5 OrderAmount, SalesPersonID FROM orders ORDER BY OrderAmount DESC
a. SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders
a. SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders ORDER BY OrderAmount
65. Consider the transaction:
Answers:
a. SELECT TOP 5 OrderAmount, SalesPersonID FROM orders
a. SELECT TOP 5 OrderAmount, SalesPersonID FROM orders ORDER BY OrderAmount DESC
a. SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders
a. SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders ORDER BY OrderAmount
65. Consider the transaction:
Begin Transaction
Create table A ( x smallint, y smallint)
Create table B ( p smallint, q smallint)
Create table A ( x smallint, y smallint)
Create table B ( p smallint, q smallint)
Update A set x=600 where y > 700
Update B set p=78 where q=99
Update B set p=78 where q=99
If @@ error != 0
Begin
RollBack Transaction
Return
End
Begin
RollBack Transaction
Return
End
Commit Transaction
Select the correct option:
Answers:
a. The transaction will work perfectly fine
a. It will report an error
a. The error handling routine contains a syntax error
a. None of the above
a. Both b and c
66. A production house needs a report about the sale where total sale of the day is more than $20,000. Which query should be used?
Answers:
a. select * from orders where sum(amount) > 20000
a. select * from orders where sum(amount) > 20000 order by OrderDate
a. select * from orders group by OrderDate having sum(amount)>20000
a. select * from orders group by OrderDate where sum(amount) > 20000
67. In ASP.NET, the control’s value set during the postback can be accessed in:
Answers:
a. Page_Init
a. Page_Load
a. Both Page_Init and Page_Load
a. Neither in Page_Load nor Page_Init
68. Which of the following connectionstring in Web.Config is correct if Microsoft SQL Server database named ClassList resides on a server named Neptune is to be used?
Answers:
a.
a.
a.
a.
69. What does the following line of code do?
Answers:
a. The transaction will work perfectly fine
a. It will report an error
a. The error handling routine contains a syntax error
a. None of the above
a. Both b and c
66. A production house needs a report about the sale where total sale of the day is more than $20,000. Which query should be used?
Answers:
a. select * from orders where sum(amount) > 20000
a. select * from orders where sum(amount) > 20000 order by OrderDate
a. select * from orders group by OrderDate having sum(amount)>20000
a. select * from orders group by OrderDate where sum(amount) > 20000
67. In ASP.NET, the control’s value set during the postback can be accessed in:
Answers:
a. Page_Init
a. Page_Load
a. Both Page_Init and Page_Load
a. Neither in Page_Load nor Page_Init
68. Which of the following connectionstring in Web.Config is correct if Microsoft SQL Server database named ClassList resides on a server named Neptune is to be used?
Answers:
a.
a.
a.
a.
69. What does the following line of code do?
<%@ Register tagprefix=”ril” Tagname=”test” Src=”rilTest.ascx” %>
Answers:
a. Register a new web site
a. Register a new tag
a. Register a new user control
a. Register a new web page
70. In which of the following namespaces is the Assembly class defined?
Answers:
a. System.Assembly
a. System.Reflection
a. System.Collections
a. System.Object
71. What data types do the RangeValidator control support?
Answers:
a. Integer, String, and Date
a. char, String, and Date
a. Integer, String, and varchar
a. Integer, bool, and Date
72. Examine the two SQL statements given below:
Answers:
a. Register a new web site
a. Register a new tag
a. Register a new user control
a. Register a new web page
70. In which of the following namespaces is the Assembly class defined?
Answers:
a. System.Assembly
a. System.Reflection
a. System.Collections
a. System.Object
71. What data types do the RangeValidator control support?
Answers:
a. Integer, String, and Date
a. char, String, and Date
a. Integer, String, and varchar
a. Integer, bool, and Date
72. Examine the two SQL statements given below:
SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY salary DESC
SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC
What is true about them?
Answers:
a. The two statements produce identical results
a. The second statement returns an error
a. There is no need to specify DESC because the results are sorted in descending order by default
a. None of the above
73. You are creating an ASP.NET application. The application will be deployed on intranet. Application uses Microsoft Windows authentication. More than 100 users will use the ASP.NET application simultaneously. What setting should be done by the project manager regarding user authentication?
Answers:
a. Add the following element to the authentication section of the Web.config file:
a. Use the Configuration Manager for your project to designate the user’s security context.
a. Write code in the Application_AuthenticateRequest event handler to configure the application to run in the user’s security context.
a. Add the following element to the system.web section of the Web.config file:
74. The names of those departments where there are more than 100 employees have to be displayed. Given two relations, employees and departments, what query should be used?
Answers:
a. The two statements produce identical results
a. The second statement returns an error
a. There is no need to specify DESC because the results are sorted in descending order by default
a. None of the above
73. You are creating an ASP.NET application. The application will be deployed on intranet. Application uses Microsoft Windows authentication. More than 100 users will use the ASP.NET application simultaneously. What setting should be done by the project manager regarding user authentication?
Answers:
a. Add the following element to the authentication section of the Web.config file:
a. Use the Configuration Manager for your project to designate the user’s security context.
a. Write code in the Application_AuthenticateRequest event handler to configure the application to run in the user’s security context.
a. Add the following element to the system.web section of the Web.config file:
74. The names of those departments where there are more than 100 employees have to be displayed. Given two relations, employees and departments, what query should be used?
Employee
———
Empno
Employeename
Salary
Deptno
———
Empno
Employeename
Salary
Deptno
Department
———
Deptno
Departname
Answers:
a. Select departname from department where deptno in (select deptno from employee group by deptno having count(*) > 100);
a. Select departname from department where deptno in (select count(*) from employee group by deptno where count(*) > 100);
a. Select departname from department where count(deptno) > 100;
a. Select departname from department where deptno in (select count(*) from employee where count(*) > 100);
75. Which of the following constraints can be used to enforce the uniqueness of rows in a table?
Answers:
a. DEFAULT and NOT NULL constraints
a. FOREIGN KEY constraints
a. PRIMARY KEY and UNIQUE constraints
a. IDENTITY columns
a. CHECK constraints
76. Consider the following two statements and choose the most appropriate option:
———
Deptno
Departname
Answers:
a. Select departname from department where deptno in (select deptno from employee group by deptno having count(*) > 100);
a. Select departname from department where deptno in (select count(*) from employee group by deptno where count(*) > 100);
a. Select departname from department where count(deptno) > 100;
a. Select departname from department where deptno in (select count(*) from employee where count(*) > 100);
75. Which of the following constraints can be used to enforce the uniqueness of rows in a table?
Answers:
a. DEFAULT and NOT NULL constraints
a. FOREIGN KEY constraints
a. PRIMARY KEY and UNIQUE constraints
a. IDENTITY columns
a. CHECK constraints
76. Consider the following two statements and choose the most appropriate option:
1. For configuration, ASP.NET uses IIS Metabase
2. For configuration, ASP.NET uses an XML based configuration system
Answers:
a. 1 only
a. 2 only
a. Both 1 and 2
a. Neither 1 nor 2
77. Which of the following is not a valid ASP.NET Web form control?
Answers:
a.
a.
a.
a.
78. Which of the following has the highest order of precedence in SQL Server?
Answers:
a. Functions and Parenthesis
a. Multiplication, Division and Exponents
a. Addition and Subtraction
a. Logical Operations
79. You are a web developer for an international literary website. Your application has a lot of text content that requires translation and few executable components. Which approach would you use?
Answers:
a. Detect and redirect
a. Use run-time adjustment
a. Use satellite assemblies
a. Allow the client browser to decide
80. Study the situation described below and identify the nature of relationship?
2. For configuration, ASP.NET uses an XML based configuration system
Answers:
a. 1 only
a. 2 only
a. Both 1 and 2
a. Neither 1 nor 2
77. Which of the following is not a valid ASP.NET Web form control?
Answers:
a.
a.
a.
a.
78. Which of the following has the highest order of precedence in SQL Server?
Answers:
a. Functions and Parenthesis
a. Multiplication, Division and Exponents
a. Addition and Subtraction
a. Logical Operations
79. You are a web developer for an international literary website. Your application has a lot of text content that requires translation and few executable components. Which approach would you use?
Answers:
a. Detect and redirect
a. Use run-time adjustment
a. Use satellite assemblies
a. Allow the client browser to decide
80. Study the situation described below and identify the nature of relationship?
Each student can enroll into more than one class. Each class can accommodate more than one student.
Answers:
a. 1 to N
a. 1 to 1
a. M to N to 1
a. M to N
a. N to 1
81. Which of the following objects is required by the Dataset to retrieve data from a database and to save updated data back to the database?
Answers:
a. DataAdapter
a. DataReader
a. Command
a. Connection
82. You want to display the titles of books that meet the following criteria:
Answers:
a. 1 to N
a. 1 to 1
a. M to N to 1
a. M to N
a. N to 1
81. Which of the following objects is required by the Dataset to retrieve data from a database and to save updated data back to the database?
Answers:
a. DataAdapter
a. DataReader
a. Command
a. Connection
82. You want to display the titles of books that meet the following criteria:
1. Purchased before November 11, 2002
2. Price is less than $500 or greater than $900
2. Price is less than $500 or greater than $900
You want to sort the result by the date of purchase, starting with the most recently bought book.
Which of the following statements should you use?
Answers:
a. SELECT book_title FROM books WHERE price between 500 and 900 AND purchase_date < ’11/11/2002′ ORDER BY purchase_date;
a. SELECT book_title FROM books WHERE price IN (500, 900) AND purchase_date< ’11/11/2002′ ORDER BY purchase date ASC;
a. SELECT book_title FROM books WHERE price < 500 OR>900 AND purchase_date DESC;
a. SELECT Book_title FROM books WHERE (price < 500 OR price > 900) AND purchase_date < ’11/11/2002′ ORDER BY purchase date DESC
83. You create an ASP.NET page named ProjectCalendar.aspx that shows scheduling information for projects in your company. The page is accessed from various other ASP and ASP.NET pages hosted throughout the company’s intranet. All employees on the intranet use Internet Explorer. ProjectCalendar.aspx has a Calendar control at the top of the page. Listed below the Calendar control is detailed information about project schedules on the data selected. When a user selects a date in the calendar, the page is refreshed to show the project schedule details for the newly selected date. Users report that after viewing two or more dates on ProjectCalendar.aspx, they need to click the browser’s Back button several times in order to return to the page they were viewing prior to accessing ProjectCalendar.aspx.
You need to modify ProjectCalendar.aspx so that the users need to click the Back button only once. What to do?
Answers:
a. Add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response.Expires(0)
a. Add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response.Cache.SetExpires (DateTime.Now())
a. Add the following attribute to the Page directive for ProjectCalendar.aspx: EnableViewState=”True”
a. Add the following attribute to the Page directive for ProjectCalendar.aspx: SmartNavigation=”True”
84. How can you pop-up a window to display text that identifies the author of the book?
Answers:
a. For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True.
a. In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the System.Web.UI.WebControls.Image class.
a. In the onmouseover event handler for each image, add code that calls the ToString() method of the System.Web.UI.WebControls.Image class.
a. For each image, set the ToolTip property to specify the text you want to display.
85. Consider the query:
SELECT name
FROM Student
WHERE name LIKE ‘_a%’;
Which names will be displayed?
Answers:
a. Names starting with “a”
a. Names containing “a” as the second letter
a. Names starting with “a” or “A”
a. Names containing “a” as any letter except the first
86. View the following Create statement:
Which of the following statements should you use?
Answers:
a. SELECT book_title FROM books WHERE price between 500 and 900 AND purchase_date < ’11/11/2002′ ORDER BY purchase_date;
a. SELECT book_title FROM books WHERE price IN (500, 900) AND purchase_date< ’11/11/2002′ ORDER BY purchase date ASC;
a. SELECT book_title FROM books WHERE price < 500 OR>900 AND purchase_date DESC;
a. SELECT Book_title FROM books WHERE (price < 500 OR price > 900) AND purchase_date < ’11/11/2002′ ORDER BY purchase date DESC
83. You create an ASP.NET page named ProjectCalendar.aspx that shows scheduling information for projects in your company. The page is accessed from various other ASP and ASP.NET pages hosted throughout the company’s intranet. All employees on the intranet use Internet Explorer. ProjectCalendar.aspx has a Calendar control at the top of the page. Listed below the Calendar control is detailed information about project schedules on the data selected. When a user selects a date in the calendar, the page is refreshed to show the project schedule details for the newly selected date. Users report that after viewing two or more dates on ProjectCalendar.aspx, they need to click the browser’s Back button several times in order to return to the page they were viewing prior to accessing ProjectCalendar.aspx.
You need to modify ProjectCalendar.aspx so that the users need to click the Back button only once. What to do?
Answers:
a. Add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response.Expires(0)
a. Add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response.Cache.SetExpires (DateTime.Now())
a. Add the following attribute to the Page directive for ProjectCalendar.aspx: EnableViewState=”True”
a. Add the following attribute to the Page directive for ProjectCalendar.aspx: SmartNavigation=”True”
84. How can you pop-up a window to display text that identifies the author of the book?
Answers:
a. For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True.
a. In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the System.Web.UI.WebControls.Image class.
a. In the onmouseover event handler for each image, add code that calls the ToString() method of the System.Web.UI.WebControls.Image class.
a. For each image, set the ToolTip property to specify the text you want to display.
85. Consider the query:
SELECT name
FROM Student
WHERE name LIKE ‘_a%’;
Which names will be displayed?
Answers:
a. Names starting with “a”
a. Names containing “a” as the second letter
a. Names starting with “a” or “A”
a. Names containing “a” as any letter except the first
86. View the following Create statement:
1 Create table Pers
2 (EmpNo Int not null,
3 EName Char not null,
4 Join_dt Datetime not null,
5 Pay Int)
2 (EmpNo Int not null,
3 EName Char not null,
4 Join_dt Datetime not null,
5 Pay Int)
Which line contains an error?
Answers:
a. 1
a. 2
a. 3
a. 4
a. 5
a. None
87. Choose the appropriate query for the Products table where data should be displayed primarily in ascending order of the ProductGroup column. Secondary sorting should be in descending order of the CurrentStock column.
Answers:
a. Select * from Products order by CurrentStock,ProductGroup
a. Select * from Products order by CurrentStock DESC,ProductGroup
a. Select * from Products order by ProductGroup,CurrentStock
a. Select * from Products order by ProductGroup,CurrentStock DESC
a. None of the above
88. Which of the following is not a service provided by Common Language Runtime (CLR)?
Answers:
a. Garbage collection
a. Multiple platform support
a. Code verification
a. Code access security
89. Which of the following is the way to handle Unmanaged Code Exceptions in ASP.NET?
Answers:
a. Server.GetLastError()
a. Exception ex
a. Raise Error
a. None of above
90. Consider the following table structure of students:
rollno int
name varchar(20)
course varchar(20)
Answers:
a. 1
a. 2
a. 3
a. 4
a. 5
a. None
87. Choose the appropriate query for the Products table where data should be displayed primarily in ascending order of the ProductGroup column. Secondary sorting should be in descending order of the CurrentStock column.
Answers:
a. Select * from Products order by CurrentStock,ProductGroup
a. Select * from Products order by CurrentStock DESC,ProductGroup
a. Select * from Products order by ProductGroup,CurrentStock
a. Select * from Products order by ProductGroup,CurrentStock DESC
a. None of the above
88. Which of the following is not a service provided by Common Language Runtime (CLR)?
Answers:
a. Garbage collection
a. Multiple platform support
a. Code verification
a. Code access security
89. Which of the following is the way to handle Unmanaged Code Exceptions in ASP.NET?
Answers:
a. Server.GetLastError()
a. Exception ex
a. Raise Error
a. None of above
90. Consider the following table structure of students:
rollno int
name varchar(20)
course varchar(20)
What will be the query to display the courses in which the number of students
enrolled is more than 5?
Answers:
a. Select course from students where count(course) > 5;
a. Select course from students where count(*) > 5 group by course;
a. Select course from students group by course;
a. Select course from students group by course having count(*) > 5;
a. Select course from students group by course where count(*) > 5;
a. Select course from students where count(group(course)) > 5;
a. Select count(course) > 5 from students;
a. None of the above
91. In Windows built-in authentication, what will happen with the following set of statements?
enrolled is more than 5?
Answers:
a. Select course from students where count(course) > 5;
a. Select course from students where count(*) > 5 group by course;
a. Select course from students group by course;
a. Select course from students group by course having count(*) > 5;
a. Select course from students group by course where count(*) > 5;
a. Select course from students where count(group(course)) > 5;
a. Select count(course) > 5 from students;
a. None of the above
91. In Windows built-in authentication, what will happen with the following set of statements?
Answers:
a. The user RIL is first denied and then allowed access
a. The user RIL is denied access because the element takes precedence over the element
a. An error is generated because deny and allow cannot both be assigned to the same user
a. Can’t say. It depends on the Windows OS version
92. When designing a database table, how do you avoid missing column values for non-primary key columns?
Answers:
a. Use UNIQUE constraints
a. Use PRIMARY KEY constraints
a. Use DEFAULT and NOT NULL constraints
a. Use FOREIGN KEY constraints
a. Use SET constraints
93. In SQL Server, which of the following is not a control statement?
Answers:
a. if…else
a. if exists
a. do…while
a. while
a. begin…end
94. You are developing an application to take orders over the Internet. When the user posts back the order form, you first check to see whether he is a registered customer of your company. If not, you must transfer control to the Register html page. Which method should you use to effect this transfer?
Answers:
a. Response.Redirect()
a. Server.Transfer()
a. Server.Execute()
a. Page.ProcessRequest()
95. The STUDENT_GRADES table has these columns:
a. The user RIL is first denied and then allowed access
a. The user RIL is denied access because the element takes precedence over the element
a. An error is generated because deny and allow cannot both be assigned to the same user
a. Can’t say. It depends on the Windows OS version
92. When designing a database table, how do you avoid missing column values for non-primary key columns?
Answers:
a. Use UNIQUE constraints
a. Use PRIMARY KEY constraints
a. Use DEFAULT and NOT NULL constraints
a. Use FOREIGN KEY constraints
a. Use SET constraints
93. In SQL Server, which of the following is not a control statement?
Answers:
a. if…else
a. if exists
a. do…while
a. while
a. begin…end
94. You are developing an application to take orders over the Internet. When the user posts back the order form, you first check to see whether he is a registered customer of your company. If not, you must transfer control to the Register html page. Which method should you use to effect this transfer?
Answers:
a. Response.Redirect()
a. Server.Transfer()
a. Server.Execute()
a. Page.ProcessRequest()
95. The STUDENT_GRADES table has these columns:
STUDENT_ID INT
SEMESTER_END DATETIME
GPA FLOAT
SEMESTER_END DATETIME
GPA FLOAT
Which of the following statements finds the highest Grade Point Average (GPA) per semester?
Answers:
a. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL
a. SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL
a. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end
a. SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades
a. SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL
96. You create an ASP.NET page named Customer.aspx. Customer.aspx contains a Web user control that displays a drop-down list box of Cities. The Web user control is named CityList, and it is defined in a file named CityList.ascx. The name of the DropDownList control in City.ascx is CuCity. You try to add code to the Page.Load event handler for Customer.aspx, but you discover that you cannot access CuCity from code in Customer.aspx. You want to ensure that code within Customer.aspx can access properties of CuCity.
What should you do?
Answers:
a. In the code-behind file for CityList.ascx, add the following line of code: Protected CuCity As DropDownList
a. In the code-behind file for Customer.aspx, add the following line of code: Public CuCity As DropDownList
a. In the code-behind file for Customer.aspx, add the following line of code: Protected CuCity As DropDownList
a. In the code-behind file for CityList.ascx, add the following line of code: Public CuCity As DropDownList
97. You are creating an ASP.NET application for AutoMart Internet Web site. A toolbar is required that will be displayed at the top of each page in the Web site. The toolbar will contain only static HTML code. The toolbar will be used in only AutoMart website. You plan to create the toolbar as a reusable component for your application. You need to create the toolbar in a minimum possible time. Which method will you adopt?
Answers:
a. Add a new component class to your ASP.NET project. Use HTML server controls to design the toolbar within the designer of the component class.
a. Create a new Web Control Library project. Create the toolbar within a Web custom control.
a. Add a new Web user control to your ASP.NET project. Create the toolbar within the Web user control.
a. Add a new Web Form to your ASP.NET project. Use HTML server controls to design the toolbar within the Web Form and save the Web Form with an ascx extension.
98. You are creating an ASP.NET application that will run on your company’s intranet. You want to control the browser window and respond immediately to non-post-back events. Which should you use?
Answers:
a. Server-side code
a. Use the Browser object’s VBScript or JavaScript properties to test if the browser can run scripts
a. Use the Browser object’s Cookies
a. Client-side scripts
Answers:
a. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL
a. SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL
a. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end
a. SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades
a. SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL
96. You create an ASP.NET page named Customer.aspx. Customer.aspx contains a Web user control that displays a drop-down list box of Cities. The Web user control is named CityList, and it is defined in a file named CityList.ascx. The name of the DropDownList control in City.ascx is CuCity. You try to add code to the Page.Load event handler for Customer.aspx, but you discover that you cannot access CuCity from code in Customer.aspx. You want to ensure that code within Customer.aspx can access properties of CuCity.
What should you do?
Answers:
a. In the code-behind file for CityList.ascx, add the following line of code: Protected CuCity As DropDownList
a. In the code-behind file for Customer.aspx, add the following line of code: Public CuCity As DropDownList
a. In the code-behind file for Customer.aspx, add the following line of code: Protected CuCity As DropDownList
a. In the code-behind file for CityList.ascx, add the following line of code: Public CuCity As DropDownList
97. You are creating an ASP.NET application for AutoMart Internet Web site. A toolbar is required that will be displayed at the top of each page in the Web site. The toolbar will contain only static HTML code. The toolbar will be used in only AutoMart website. You plan to create the toolbar as a reusable component for your application. You need to create the toolbar in a minimum possible time. Which method will you adopt?
Answers:
a. Add a new component class to your ASP.NET project. Use HTML server controls to design the toolbar within the designer of the component class.
a. Create a new Web Control Library project. Create the toolbar within a Web custom control.
a. Add a new Web user control to your ASP.NET project. Create the toolbar within the Web user control.
a. Add a new Web Form to your ASP.NET project. Use HTML server controls to design the toolbar within the Web Form and save the Web Form with an ascx extension.
98. You are creating an ASP.NET application that will run on your company’s intranet. You want to control the browser window and respond immediately to non-post-back events. Which should you use?
Answers:
a. Server-side code
a. Use the Browser object’s VBScript or JavaScript properties to test if the browser can run scripts
a. Use the Browser object’s Cookies
a. Client-side scripts
3 NOT Answered Yet Test Questions:
(hold on, will be updated soon)
99. Which of following is correct if you want to import a C# class called myClass that is implemented in the myClass.cs file into a .aspx page?
Answers:
a. <%@Page Import=”myClass” Src=”myClass.cs” %>
a. <%@Page Inherits=”myClass” Src=”myClass.cs” %>
a. <%@Page Include=”myClass” Src=”myClass.cs” %>
a. <%@Page Insert=”myClass” Src=”myClass.cs” %>
100. Which of the following is not a valid directive in ASP.NET?
Answers:
a. @Page
a. @Implements
a. @Insert
a. @Register
a. @Reference
(hold on, will be updated soon)
99. Which of following is correct if you want to import a C# class called myClass that is implemented in the myClass.cs file into a .aspx page?
Answers:
a. <%@Page Import=”myClass” Src=”myClass.cs” %>
a. <%@Page Inherits=”myClass” Src=”myClass.cs” %>
a. <%@Page Include=”myClass” Src=”myClass.cs” %>
a. <%@Page Insert=”myClass” Src=”myClass.cs” %>
100. Which of the following is not a valid directive in ASP.NET?
Answers:
a. @Page
a. @Implements
a. @Insert
a. @Register
a. @Reference
No comments:
Post a Comment