ASP.NET with SQL Server MCQs

ASP.NET with SQL Server MCQs

ASP.NET with SQL Server MCQs will test your knowledge. Our Free ASP.NET with SQL Server multiple-choice questions and answers are in quiz format, so test your skill in an easy and fun way.

1:

Which of the following are false for ASP.NET events?

A.   Events are specialized forms of delegates

B.   Events are used to support the callback event notification model

C.   The signature of any event handler is fixed

D.   All of the above are true

2:

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: <asp:TextBox ID="MemberID" Columns="20" Runat="server"/> 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)

A.   In the Page directive for PersonalDetails.aspx, ensure that the AutoEventWireup attributes is set to "true".

B.   In the Page directive for PersonalDetails.aspx, ensure that the EnableViewState attribute is set to "true".

C.   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 theserver

D.   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

3:

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?

A.   Create a Microsoft Visual Studio .NET Enterprise template

B.   Create a sample HTML page

C.   Create a sample ASP.NET Web form

D.   Create a cascading style sheet

4:

Which of the following are not true in ASP.NET?

A.   A try block can have more than one catch blocks

B.   Every try block must have a catch block

C.   Every try block must have a finally block

D.   All exception classes are to be derived from System.Exception

5:

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?

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.

B.   Create a new Web Control Library project. Create the toolbar within a Web custom control.

C.   Add a new Web user control to your ASP.NET project. Create the toolbar within the Web user control.

D.   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

6:

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?

A.   Server-side code

B.   Use the Browser object's VBScript or JavaScript properties to test if the browser can run scripts

C.   Use the Browser object's Cookies

D.   Client-side scripts

7:

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?

A.   Response.Redirect()

B.   Server.Transfer()

C.   Server.Execute()

D.   Page.ProcessRequest()

8:

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

A.   Statement 1 is true and statement 2 is false

B.   Statement 2 is true and statement 1 is false

C.   Both statements 1 and 2 are true

D.   Both statements 1 and 2 are false

9:

How can you pop-up a window to display text that identifies the author of the book?

A.   For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True.

B.   In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the System.Web.UI.WebControls.Image class.

C.   In the onmouseover event handler for each image, add code that calls the ToString() method of the System.Web.UI.WebControls.Image class.

D.   For each image, set the ToolTip property to specify the text you want to display.

10:

In ASP.NET, the control's value set during the postback can be accessed in?

A.   Page_Init

B.   Page_Load

C.   Both Page_Init and Page_Load

D.   Neither in Page_Load nor Page_Init

11:

Which of the following is not a service provided by Common Language Runtime (CLR)?

A.   Garbage collection

B.   Multiple platform support

C.   Code verification

D.   Code access security

12:

What does the following line of code do?

<%@ Register tagprefix="ril" Tagname="test" Src="rilTest.ascx" %>

A.   Register a new web site

B.   Register a new tag

C.   Register a new user control

D.   Register a new web page

13:

What will happen if the Server configuration file and the Application configuration file have different values for session state?

A.   The Server configuration will always override the Application configuration

B.   The Application configuration will always override the Server configuration

C.   The Server configuration will override the Application configuration if allowOverride is set to "false" in the settings in the Server configuration file

D.   The Application configuration will override the Server configuration if allowOverride is set to "false" in the settings in the Server configuration file

14:

What data types do the RangeValidator control support?

A.   Integer, String, and Date

B.   char, String, and Date

C.   Integer, String, and varchar

D.   Integer, bool, and Date

15:

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?

A.   <%@Page Import="myClass" Src="myClass.cs" %>

B.   <%@Page Inherits="myClass" Src="myClass.cs" %>

C.   <%@Page Include="myClass" Src="myClass.cs" %>

D.   <%@Page Insert="myClass" Src="myClass.cs" %>

16:

Which DLL is responsible for processing the page requests running on the server?

A.   Internet Server Application Programming Interface

B.   Internet Information Server Program

C.   Webserver interface

D.   IIS Application

17:

In which of the following namespaces is the Assembly class defined?

A.   System.Assembly

B.   System.Reflection

C.   System.Collections

D.   System.Object

18:

Which of the following are the valid methods of the SqlTransaction class?

A.   Commit

B.   Terminate

C.   Save

D.   Close

E.   Rollback

19:

In ASP.NET, which of the following is not an event of the Page class?

A.   Init

B.   Load

C.   Error

D.   Abort

20:

Which of the following is not a valid directive in ASP.NET?

A.   @Page

B.   @Implements

C.   @Insert

D.   @Register

E.   @Reference

21:

Which of the following is the way to handle Unmanaged Code Exceptions in ASP.NET?

A.   Server.GetLastError()

B.   Exception ex

C.   Exception ex

D.   None of above

22:

How can you view the results of Trace.Write() statements?

A.   By enabling page tracing

B.   By enabling application tracing

C.   By enabling server tracing

D.   By looking up the system.log file

23:

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

A.   1 only

B.   2 only

C.   Both 1 and 2

D.   Neither 1 nor 2

24:

When you make some changes to the configuration file, do you need to stop and start IIS to apply the new settings?

A.   Yes

B.   No

25:

Which of the following directives can be used to include libraries in an ASP.NET page?

A.   Include

B.   Import

C.   Insert

D.   Both a and b

26:

In ASP.NET, the exception handling should be used?

A.   To signal the occurrence of unusual or unanticipated program events

B.   To redirect the program's normal flow of control

C.   In cases of potential logic or user input errors

D.   In case of overflow of an array boundary

27:

Which of the following scenarios are applicable to Window Workflow Foundation?

A.   Document-centric workflows

B.   Human workflows

C.   User-interface page flows

D.   Builtin support for communications across multiple applications and/or platforms

28:

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

Department

---------

Deptno

Departname

A.   Select departname from department where deptno in (select deptnofrom employee group by deptno having count(*) > 100);

B.   Select departname from department where deptno in (select count(*)from employee group by deptno where count(*) > 100);

C.   Select departname from department where count(deptno) > 100;

D.   Select departname from department where deptno in (select count(*)from employee where count(*) > 100);

29:

Which of the following is not a valid SQL OPERATOR?

A.   Between..and..

B.   Like

C.   In

D.   Is null

E.   Having

F.   Not in

G.   All of the above are valid

30:

Consider the query:

SELECT name    

FROM Student    

WHERE name LIKE '_a%';

Which names will be displayed?

A.   Names starting with "a"

B.   Names containing "a" as the second letter

C.   Names starting with "a" or "A"

D.   Names containing "a" as any letter except the first

31:

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?

A.   It returns employees whose salary is 50% more than $23,000

B.   It returns employees who have 50% commission rate or salary greater than $23,000

C.   It returns employees whose salary is 50% less than $23,000

D.   None of the above

32:

Which of the following are aggregate functions in SQL?

A.   Avg

B.   Select

C.   Order By

D.   Sum

E.   Union

F.   Group by

G.   Having

33:

What is the correct SQL syntax for selecting all the columns where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

A.   SELECT * FROM Persons WHERE LastName > 'Hansen', LastName < 'Pettersen'

B.   SELECT LastName > 'Hansen' AND LastName < 'Pettersen' FROM Persons

C.   SELECT * FROM customers WHERE LastName > 'Hansen' AND LastName > 'Pettersen'

D.   SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

34:

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 )

Which statement will produce the report correctly?

A.   SELECT TOP 5 OrderAmount, SalesPersonID FROM orders

B.   SELECT TOP 5 OrderAmount, SalesPersonID FROM orders ORDER BY OrderAmount DESC

C.   SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders

D.   SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders ORDER BY OrderAmount

35:

Which of the following has the highest order of precedence in SQL Server?

A.   Functions and Parenthesis

B.   Multiplication, Division and Exponents

C.   Addition and Subtraction

D.   Logical Operations

36:

Which of the following constraints can be used to enforce the uniqueness of rows in a table?

A.   DEFAULT and NOT NULL constraints

B.   FOREIGN KEY constraints

C.   PRIMARY KEY and UNIQUE constraints

D.   IDENTITY columns

E.   CHECK constraints

37:

In which sequence are queries and sub-queries executed by the SQL Engine?

A.   primary query -> sub query -> sub sub query and so on

B.   sub sub query -> sub query -> prime query

C.   the whole query is interpreted at one time

D.   there is no fixed sequence of interpretation, the query parser takes a decision on the fly

38:

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?

A.   select * from Pers where joining_date from '1/1/2005' to '1/2/2005', job= 'Analyst' or 'clerk' or 'salesman'

B.   select * from Pers where joining_date between '1/1/2005' to '1/2/2005', job= 'Analyst' or job= 'clerk' or job= 'salesman'

C.   select * from Pers where joining_date between '1/1/2005' and '1/2/2005' and (job= 'Analyst' or 'clerk' or 'salesman')

D.   None of the above

39:

Which of the following datatypes is not supported by SQL-Server?

A.   Character

B.   Binary

C.   Logical

D.   Date

E.   Numeric

F.   All are supported

40:

What is the order of precedence among the following operators?

1. IN

2. NOT

3. AND

4. OR

A.   1,2,3,4

B.   2,3,4,1

C.   1,2,4,3

D.   1,4,3,2

E.   4,3,2,1

F.   4,1,2,3

G.   4,2,1,3

H.   3,2,1,4

41:

The simplest query must include at least________ and _________?

A.   A select clause

B.   A where clause

C.   A from clause

D.   A group by clause

E.   A having clause

F.   An order by clause

42:

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

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?

A.   SELECT book_title FROM books WHERE price between 500 and 900 AND purchase_date < '11/11/2002' ORDER BY purchase_date;

B.   SELECT book_title FROM books WHERE price IN (500, 900) AND purchase_date< '11/11/2002' ORDER BY purchase date ASC;

C.   SELECT book_title FROM books WHERE price < 500 OR>900 AND purchase_date DESC;

D.   SELECT Book_title FROM books WHERE (price < 500 OR price > 900) AND purchase_date < '11/11/2002' ORDER BY purchase date DESC

43:

Is the FROM clause necessary in every SELECT statement?

A.   Yes

B.   No

44:

Is it possible to insert several rows into a table with a single INSERT statement?

A.   No

B.   Yes

45:

Which line of code should you use to copy the edited rows from dataset productInfo into another dataset productChanges?

A.   productChanges = productInfo.GetChanges(DataRowState.Detached)

B.   productChanges = productInfo.GetChanges()

C.   productChanges.Merge(productInfo, true)

D.   productChanges.Merge(productInfo, false)

46:

Consider the following queries:

1. select * from employee where department LIKE "[^F-M]%";

2. Select * from employee where department = "[^F-M]%";

Select the correct option:

A.   Query 2 will return an error

B.   Both the queries will return the same set of records

C.   Query 2 is perfectly correct

D.   Query 2 would return one record less than Query 1

47:

What is wrong with the following query?

select * from Orders where OrderID = (select OrderID from OrderItems where ItemQty > 50)

A.   In the sub query, '*' should be used instead of 'OrderID'

B.   The sub query can return more than one row, so, '=' should be replaced with 'in'

C.   The sub query should not be in parenthesis

D.   None of the above

48:

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?

A.   select * from orders where sum(amount) > 20000

B.   select * from orders where sum(amount) > 20000 order by OrderDate

C.   select * from orders group by OrderDate having sum(amount)>20000

D.   select * from orders group by OrderDate where sum(amount) > 20000

49:

Examine the description of the STUDENTS table:

STD_ID                INT

COURSE_ID        VARCHAR (10)

START_DATE        DATETIME

END_DATE        DATETIME

 

The aggregate functions valid on the START_DATE column are:

A.   SUM(start_date)

B.   AVG(start_date)

C.   COUNT(start_date)

D.   AVG(start_date, end_date)

E.   MIN(start_date)

50:

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?

A.   DataAdapter

B.   DataReader

C.   Command

D.   Connection

51:

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';

A.   The query will return "Designing, Packing"

B.   The query will return "Designing, production, Packing"

C.   The query will return "packing"

D.   Strings cannot be compared using < operator

E.   The query will return "Designing"

52:

When designing a database table, how do you avoid missing column values for non-primary key columns?

A.   Use UNIQUE constraints

B.   Use PRIMARY KEY constraints

C.   Use DEFAULT and NOT NULL constraints

D.   Use FOREIGN KEY constraints

E.   Use SET constraints

53:

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?

A.   Set conn = New connection ; With conn ; .Provider = "SqlOleDB" ; ConnectionString ="User ID=sa;"&& "Data Source= Neptune;"&& "Initial Catalog=ClassList"

B.   Set conn = New connection ; With conn ; .Provider = "Neptune" ; ConnectionString ="User ID=sa;"&& "Data Source= Neptune;"&& "Initial Catalog=ClassList"

C.   Set conn = New connection ; With conn ; .Provider = "SqlOleDB" ; ConnectionString ="User ID=sa;"&& "Data Source= Neptune;"

54:

Which of the following queries is valid?

A.   Select * from students where marks > avg(marks);

B.   Select * from students order by marks where subject = 'SQL';

C.   Select * from students having subject ='SQL';

D.   Select name from students group by subject, name;

E.   Select group(*) from students;

F.   Select name,avg(marks) from students;

G.   None of the above

55:

You want to access data from the "Customer" table in the database. You generate a DataSet named "MyDataSet" by adding "Customer" table to it. Which of the following statements should you use to load the data from the database into "MyDataSet" which has been loaded with multiple tables, using a SqlDataAdapter named "MyAdapter"

A.   MyAdapter.Fill(MyDataSet,"Customer")

B.   MyAdapter.Fill("MyDataSet",Customer).

C.   MyAdapter.Fill(MyDataSet)

D.   MyAdapter.Fill("MyDataSet")

56:

Examine the query:-

select (2/2/4) from tab1; where tab1 is a table with one row.

This would give a result of:

A.   4

B.   2

C.   1

D.   5

E.   25

F.   0

G.   8

H.   24

57:

In a SQL Server query, what will the output be if you try to perform arithmetic on NULL values?

A.   0

B.   NULL

C.   It will generate an error message

D.   Can't be determined

58:

Which operator will be evaluated first in the following statement?

select (age + 3 * 4 / 2 - 8) from emp

A.   +

B.   -

C.   /

D.   *

59:

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?

A.   The two statements produce identical results

B.   The second statement returns an error

C.   There is no need to specify DESC because the results are sorted in descending order by default

D.   None of the above

60:

Examine the data in the EMPLOYEES table given below:

LAST_NAME  DEPTARTMENT_ID     SALARY

ALLEN                10                      3000

MILLER              20                     1500

King                   20                      2200

Davis                 30                      5000

Which of the following Subqueries work?

A.   SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department_id);

B.   SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);

C.   SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);

D.   SELECT department_id FROM employees WHERE SALARY > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);

E.   SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));

61:

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?

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.

B.   . 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

C.   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

D.   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

E.   None of these

62:

Consider the transaction:

Begin Transaction

      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

 

          If @@ error != 0

          Begin

          RollBack Transaction

            Return

          End

 

     Commit Transaction

Select the correct option:

A.   The transaction will work perfectly fine

B.   It will report an error

C.   The error handling routine contains a syntax error

D.   None of the above

E.   Both b and c

63:

The STUDENT_GRADES table has these columns:

STUDENT_ID        INT

SEMESTER_END        DATETIME

GPA                FLOAT

Which of the following statements finds the highest Grade Point Average (GPA) per semester?

A.   SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL

B.   SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL

C.   SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end

D.   SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades

E.   SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL

64:

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?

A.   DataRow

B.   DataSet

C.   DataTable

D.   DataReader

65:

Consider the following two tables:

1. customers( customer_id, customer_name)

2. branch ( branch_id, branch_name )

What will be the output if the following query is executed:

Select *, branch_name from customers,branch

A.   It will return the fields customer_id, customer_name, branch_name

B.   It will return the fields customer_id, customer_name, branch_id, branch_name

C.   It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name

D.   It will return an empty set since the two tables do not have any common field name

E.   It will return an error since * is used alone for one table only

66:

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

A.   Select * from Products order by CurrentStock,ProductGroup

B.   Select * from Products order by CurrentStock DESC,ProductGroup

C.   Select * from Products order by ProductGroup,CurrentStock

D.   Select * from Products order by ProductGroup,CurrentStock DESC

E.   None of the above

67:

How can you change "Hansen" into "Nilsen" in the LastName column in the Persons Table?

A.   UPDATE Persons SET LastName = 'Nilsen' WHERE LastName = 'Hansen'

B.   UPDATE Persons SET LastName = 'Hansen' INTO LastName = 'Nilsen'

C.   SAVE Persons SET LastName = 'Nilsen' WHERE LastName = 'Hansen'

D.   SAVE Persons SET LastName = 'Hansen' INTO LastName = 'Nilsen'

68:

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?

A.   Select course from students where count(course) > 5;

B.   Select course from students where count(*) > 5 group by course;

C.   Select course from students group by course;

D.   Select course from students group by course having count(*) > 5;

E.   Select course from students group by course where count(*) > 5;

F.   Select course from students where count(group(course)) > 5;

G.   Select count(course) > 5 from students;

H.   None of the above

69:

What will happen if you query the emp table as shown below:

select empno, DISTINCT ename, Salary from emp;

A.   EMPNO, unique value of ENAME and then SALARY are displayed

B.   EMPNO, unique value ENAME and unique value of SALARY are displayed

C.   DISTINCT is not a valid keyword in SQL

D.   No values will be displayed because the statement will return an error

70:

Which one of the following correctly selects rows from the table myTable that have null in column column1?

A.   SELECT * FROM myTable WHERE column1 is null

B.   SELECT * FROM myTable WHERE column1 = null

C.   SELECT * FROM myTable WHERE column1 EQUALS null

D.   SELECT * FROM myTable WHERE column1 NOT null

E.   SELECT * FROM myTable WHERE column1 CONTAINS null

71:

In SQL Server, which of the following is not a control statement?

A.   if...else

B.   if exists

C.   do...while

D.   while

E.   begin...end

72:

Which of the following is the syntax for creating an Index?

A.   CREATE [UNIQUE] INDEX index_name OF tbl_name (index_columns)

B.   CREATE [UNIQUE] INDEX OF tbl_name (index_columns)

C.   CREATE [UNIQUE] INDEX ON tbl_name (index_columns)

D.   CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns)

73:

How you will generate a report with minimum network traffic?

A.   Use Microsoft SQL Server indexes to optimize the data calculations

B.   Implement the calculations in a business layer class

C.   Implement the calculations in a data layer class

D.   Use Microsoft SQL Server stored procedures for the data calculations

74:

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?

A.   Populate the data objects with data from the database. Populate the controls with values retrieved from the data objects.

B.   Populate the business objects with data from the database. Populate the controls with values retrieved from the business objects.

C.   Populate the data objects with data from the database. Populate the business objects with data from the data objects. Populate the controls with values retrieved from the business objects

D.   Bind the controls directly to the database.

75:

Which of the following is not a valid character datatype in SQL Server?

A.   BLOB

B.   VARCHAR

C.   TEXT

D.   VARTEXT

76:

Which of the following statements about SQL Server comments is false?

A.   /* … */ are used for multiline comments

B.   // is used for single line comments

C.   – is used for single line comments

D.   Nested comments are allowed i.e. /* comment 1 /* comment 2 */ comment 1*/

E.   ‘ is used for single line comments

77:

Which of the following are not date parts?

A.   Quarter

B.   dayofweek

C.   dayofyear

D.   weekday

78:

Which one of the following must be specified in every DELETE statement?

A.   Table Name

B.   Database name

C.   LIMIT clause

D.   WHERE clause

E.   Column Names

79:

Which of the following commands is used to change the structure of table?

A.   CHANGE TABLE

B.   MODIFY TABLE

C.   ALTER TABLE

D.   UPDATE TABLE

80:

What is the correct SQL syntax for returning all the columns from a table named “Persons” sorted REVERSE alphabetically by “FirstName”?

A.   SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC

B.   SELECT * FROM Persons SORT REVERSE ‘FirstName’

C.   SELECT * FROM Persons ORDER BY ‘FirstName’

D.   SELECT * FROM Persons ORDER BY FirstName DESC

E.   SELECT * FROM Persons ORDER BY DESC FirstName

81:

What is the maximum value that can be stored for a datetime field?

A.   Dec 31, 9999

B.   Jun 6, 2079

C.   Jan 1, 2753

D.   Jan 1, 2100

82:

How can you view the structure of a table named “myTable” in SQL Server?

A.   desc myTable

B.   desc table myTable

C.   sp_columns myTable

D.   None of the above

E.   Using either option a or c

83:

What does referential integrity (also called relational integrity) prevent?

A.   Loss of data from employee sabotage

B.   Loss of data from any one corrupted table

C.   Recursive joins

D.   One-to-many or many-to-many relationships between columns in a table

E.   Data redundancy

84:

Which of the following is not a global variable?

A.   @@colcount

B.   @@error

C.   @@rowcount

D.   @@version

E.   All are valid global variables

85:

Which of the following is not a valid binary datatype in SQL Server?

A.   BINARY

B.   VARBINARY

C.   BIT

D.   IMAGE

E.   TESTAMP

86:

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?

A.   Add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response .Expires(0)

B.   add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response.Cache.SetExpires(DateTime.Now())

C.   Add the following attribute to the Page directive for ProjectCalendar.aspx: EnableViewState="True"

D.   Add the following attribute to the Page Directive for ProjectCalendar.aspx: SmartNavigation="True"

87:

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?

A.   <add key="SqlConnect" value="Data Source=Neptune;Initial Catalog=ClassList;Persist Security Info=True;User ID=xyz;Password=abc">

B.   <add key="SqlConnect" value="Data Source=ClassList;Initial Catalog=Neptune;Persist Security Info=True;User ID=xyz;Password=abc">

C.   <add key="SqlConnect" value="Data Source=abc;Initial Catalog=xyz;Persist Security Info=True;User ID=Neptune;Password=ClassList">

D.   <add key="SqlConnect" value="Data Source=abc;Initial Catalog=xyz;Persist Security Info=True;User ID=ClassList;Password=Neptune">

88:

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?

A.   Set the Enabled property of the GridView control to false.

B.   Set the Enable ViewState property of the GridView to false.

C.   Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is false.

D.   Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is false.

89:

What is the total no. of events in Global.asax file in Asp.NET?

A.   20

B.   25

C.   19

D.   32

90:

In SQL Server, you should avoid the use of cursors because:

A.   They are very difficult to implement

B.   Programs with cursors take more time to run, hence performance degrades

C.   Programs with cursors are more lengthy, hence they consume more space/memory

D.   No, you must maximize the use of cursors because they improve performance

91:

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?

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.

B.   Use Xcopy deployment for the Web application and its supporting assemblies.

C.   Use Xcopy deployment to deploy the Web application. Use merge modules to install the supporting assemblies.

D.   Use a Web installation package to install the Web application and the supporting assemblies.

92:

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?

A.   The variable is not currently in scope.

B.   The variable has been defined as public.

C.   The variable has been defined as private.

D.   The variable has not been defined in this project.

A.   Dim CustomerAddress As New Cookie("CustomerInfo")

B.   Dim CustomerAddress As Cookie("CustomerInfo")

C.   Dim CustomerAddress As HttpCookie("CustomerInfo")

D.   Dim CustomerAddress As New HttpCookie("CustomerInfo")

94:

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?

A.   View State

B.   Hidden fields

C.   State Server

D.   Application state

E.   SQL Server

95:

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?

A.   EditCommand

B.   OnClick

C.   ButtonClicked

D.   ItemCommand

96:

Consider the following ASP.NET events:

1. Page_Load
2. Page_Unload
3. Control Event
4. Page_Init

What is the order of their execution?

A.   1,2,3,4

B.   1,4,3,2

C.   4,1,3,2

D.   4,3,1,2

97:

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?

A.   In the code-behind file for CityList.ascx, add the following line of code: Protected CuCity As DropDownList

B.   In the code-behind file for Customer.aspx, add the following line of code: Public CuCity As DropDownList

C.   In the code-behind file for Customer.aspx, add the following line of code: Protected CuCity As DropDownList

D.   In the code-behind file for CityList.ascx, add the following line of code: Public CuCity As DropDownList

98:

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?

A.   Add the following element to the authentication section of the Web.config file: <allow users="?"/>

B.   Use the Configuration Manager for your project to designate the user's security context.

C.   Write code in the Application_AuthenticateRequest event handler to configure the application to run in the user's security context.

D.   Add the following element to the system.web section of the Web.config file: <identity impersonate="true"/>

99:

What is the correct order of clauses in the select statement?

1        select
2        order by
3        where
4        having
5        group by

A.   1,2,3,4,5

B.   1,3,5,4,2

C.   1,3,5,2,4

D.   1,3,2,5,4

E.   1,3,2,4,5

F.   1,5,2,3,4

G.   1,4,2,3,5

H.   1,4,3,2,5

100:

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?

A.   Use a RichTextBox object to hold the data as it is being concatenated.

B.   Use the Append method of the String class.

C.   Use the String class and the & operator.

D.   Use the StringBuilder class.