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:
Answers:
<%@ 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)
Answers:
Answers:
<%@ 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:
ALLEN 10 3000
MILLER 20 1500
King 20 2200
Davis 30 5000
Which of the following Subqueries will execute without any error?
Answers:
select empno, DISTINCT ename, Salary from emp;
Answers:
Answers:
select (2/2/4) from tab1;
where tab1 is a table with one row. This would give a result of:
Answers:
Answers:
Answers:
Answers:
(a)MSIL code is platform independent
(b)CLR is platform dependent
Answers:
Statement 1: Value types are allocated on a stack
Statement 2: Reference types are allocated on a managed CLR Heap
Answers:
Answers:
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
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:
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:
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:
What should you do?
Answers:
Answers:
Answers:
Answers:
Answers:
ProductID
ProductName
CurrentStock
MinimumStock
Two possible queries are:
(a)select * from products where currentStock > MinimumStock + 50
(b)select * from products where currentStock – 50 > MinimumStock
Choose the appropriate option with regard to the above queries.
Answers:
Answers:
Answers:
Answers:
Answers:
1. select * from employee where department LIKE ‘[^F-M]%’;
2. select * from employee where department = ‘[^F-M]%’;
Select the correct option:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Marketing, Designing, production, Packing
What will be the result of the following query?
select * from table where department < ‘marketing’;
Answers:
Answers:
Answers:
Answers:
1 IN
2 NOT
3 AND
4 OR
Answers:
Answers:
1 select
2 order by
3 where
4 having
5 group by
Answers:
Answers:
Answers:
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:
Answers:
Answers:
Answers:
select (age + 3 * 4 / 2 – 8) from emp
Answers:
Answers:
select * from Orders where OrderID = (select OrderID from OrderItems where ItemQty > 50)
Answers:
Answers:
Answers:
Answers:
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
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
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?
Answers:
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:
Answers:
Answers:
Answers:
Answers:
<%@ Register tagprefix=”ril” Tagname=”test” Src=”rilTest.ascx” %>
Answers:
Answers:
Answers:
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:
Answers:
Employee
———
Empno
Employeename
Salary
Deptno
Department
———
Deptno
Departname
Answers:
Answers:
2. For configuration, ASP.NET uses an XML based configuration system
Answers:
Answers:
Answers:
Answers:
Each student can enroll into more than one class. Each class can accommodate more than one student.
Answers:
Answers:
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?
Answers:
You need to modify ProjectCalendar.aspx so that the users need to click the Back button only once. What to do?
Answers:
Answers:
SELECT name
FROM Student
WHERE name LIKE ‘_a%’;
Which names will be displayed?
Answers:
1 Create table Pers
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:
Answers:
Answers:
Answers:
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:
<system.web>
<authorization>
<deny users=”RIL”/>
<allow users=”RIL”/>
</authorization>
</system.web>
Answers:
Answers:
Answers:
Answers:
STUDENT_ID INT
SEMESTER_END DATETIME
GPA FLOAT
Which of the following statements finds the highest Grade Point Average (GPA) per semester?
Answers:
What should you do?
Answers:
Answers:
Answers:
Answers:
- Begin a transaction
- Create a connection to the database
- Create a data set using an adapter object
- Use the data set to display data or to change items in the database
- Update the database from the data set
- Close the database connection
- Check for transaction errors
Answers:
- Avg
- Select
- Order By
- Sum
- Union
- Group by
- Having
<%@ 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)
Answers:
- In the Page directive for PersonalDetails.aspx, ensure that the AutoEventWireup attributes is set to “true”.
- In the Page directive for PersonalDetails.aspx, ensure that the EnableViewState attribute is set to “true”.
- 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.
- 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.
Answers:
- A select clause
- A where clause
- A from clause
- A group by clause
- A having clause
- An order by clause
<%@ 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:
- <WoodySideBankControls:CSC1 id=”Control1″ runat=”server” />
- <WoodySideBankNameSpace:CSC1 id=”Control1″ runat=”server” />
- <WoodySideBankControls:Control1 id=”CSC1″ runat=”server” />
- <WoodySideBankNameSpace:Control1 id=”CSC1″ runat=”server” />
ALLEN 10 3000
MILLER 20 1500
King 20 2200
Davis 30 5000
Which of the following Subqueries will execute without any error?
Answers:
- SELECT distinct department_id FROM employees Where salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);
- SELECT distinct department_id FROM employees Where salary > (SELECT AVG(salary) FROM employees GROUP BY department_id);
- SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);
- SELECT distinct department_id FROM employees Where salary > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);
- SELECT distinct department_id FROM employees Where salary < (SELECT AVG(salary) FROM employees GROUP BY department_id);
select empno, DISTINCT ename, Salary from emp;
Answers:
- EMPNO, unique value of ENAME and then SALARY are displayed
- EMPNO, unique value ENAME and unique value of SALARY are displayed
- DISTINCT is not a valid keyword in SQL
- No values will be displayed because the statement will return an error
Answers:
- Command
- Locals
- Output
- Breakpoints
select (2/2/4) from tab1;
where tab1 is a table with one row. This would give a result of:
Answers:
- 4
- 2
- 1
- .5
- .25
- 0
- 8
- 24
Answers:
- No
- Yes
Answers:
- DataRow
- DataSet
- DataTable
- DataReader
Answers:
- Commit
- Terminate
- Save
- Close
- Rollback
(a)MSIL code is platform independent
(b)CLR is platform dependent
Answers:
- Only (a) is true, (b) is false
- Only (b) is true, (a) is false
- Both (a) and (b) are true
- Both (a) and (b) are false
Statement 1: Value types are allocated on a stack
Statement 2: Reference types are allocated on a managed CLR Heap
Answers:
- Statement 1 is true and statement 2 is false
- Statement 2 is true and statement 1 is false
- Both statements 1 and 2 are true
- Both statements 1 and 2 are false
Answers:
- The variable is not currently in scope.
- The variable has been defined as public.
- The variable has been defined as private.
- The variable has not been defined in this project.
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
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:
- Add code to the Application_OnStart event handler in the Global.asax file to set the values of the text strings.
- Add code to the Application_BeginRequest event handler in the Global.asax file to set the values of the text strings.
- Add code to the Session_OnStart event handler in the Global.asax file to set the values of the text strings.
- 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.
- 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.
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:
- It returns employees whose salary is 50% more than $23,000
- It returns employees who have 50% commission rate or salary greater than $23,000
- It returns employees whose salary is 50% less than $23,000
- None of the above
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:
- The value displayed in the CALC_VALUE column will be lower
- The value displayed in the CALC_VALUE column will be higher
- There will be no difference in the value displayed in the CALC_VALUE column
- An error will be reported
What should you do?
Answers:
- Set the Enabled property of the GridView control to false.
- Set the EnableViewState property of the GridView to false.
- Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is false.
- Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack property of the page is true.
Answers:
- Finally block will be executed only if an error occurs
- Finally block is executed after Catch block when no error occurs
- Finally block is executed after Try block regardless of whether an error occurs
- Finally block is executed only when no error occurs
Answers:
- View State
- Hidden fields
- State Server
- Application state
- SQL Server
Answers:
- EditCommand
- OnClick
- ButtonClicked
- ItemCommand
Answers:
- productChanges = productInfo.GetChanges(DataRowState.Detached)
- productChanges = productInfo.GetChanges()
- productChanges.Merge(productInfo, true)
- productChanges.Merge(productInfo, false)
ProductID
ProductName
CurrentStock
MinimumStock
Two possible queries are:
(a)select * from products where currentStock > MinimumStock + 50
(b)select * from products where currentStock – 50 > MinimumStock
Choose the appropriate option with regard to the above queries.
Answers:
- (a) is correct
- (b) is correct
- (a) and (b) both are correct
- (a) and (b) both are incorrect
Answers:
- Use Microsoft SQL Server indexes to optimize the data calculations
- Implement the calculations in a business layer class
- Implement the calculations in a data layer class
- Use Microsoft SQL Server stored procedures for the data calculations
Answers:
- Cab
- Merge Module
- Web Setup
- Setup
Answers:
- They are very difficult to implement
- Programs with cursors take more time to run, hence performance degrades
- Programs with cursors are more lengthy, hence they consume more space/memory
- No, you must maximize the use of cursors because they improve performance
Answers:
- SELECT * FROM myTable WHERE column1 is null
- SELECT * FROM myTable WHERE column1 = null
- SELECT * FROM myTable WHERE column1 EQUALS null
- SELECT * FROM myTable WHERE column1 NOT null
- SELECT * FROM myTable WHERE column1 CONTAINS null
1. select * from employee where department LIKE ‘[^F-M]%’;
2. select * from employee where department = ‘[^F-M]%’;
Select the correct option:
Answers:
- Query 2 will return an error
- Both the queries will return the same set of records
- Query 2 is perfectly correct
- Query 2 would return one record less than Query 1
Answers:
- 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.
- Use Xcopy deployment for the Web application and its supporting assemblies.
- Use Xcopy deployment to deploy the Web application. Use merge modules to install the supporting assemblies.
- Use a Web installation package to install the Web application and the supporting assemblies.
Answers:
- Between..and..
- Like
- In
- Is null
- Having
- Not in
- All of the above are valid.
Answers:
- Set the AutoPostBack property of txtDelDate to False. Write code in the ServerValidate event handler to validate the date.
- Set the AutoPostBack property of txtDelDate to True. Write code in the ServerValidate event handler to validate the date.
- 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.
- 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.
Answers:
- to signal the occurrence of unusual or unanticipated program events
- to redirect the program’s normal flow of control
- in cases of potential logic or user input errors
- in case of overflow of an array boundary
Answers:
- By enabling page tracing
- By enabling application tracing
- By enabling server tracing
- By looking up the system.log file
Answers:
- Events are specialized forms of delegates
- Events are used to support the callback event notification model
- The signature of any event handler is fixed
- All of the above are true
Answers:
- The Server configuration will always override the Application configuration
- The Application configuration will always override the Server configuration
- The Server configuration will override the Application configuration if allowOverride is set to “false” in the settings in the Server configuration file
- The Application configuration will override the Server configuration if allowOverride is set to “false” in the settings in the Server configuration file
Marketing, Designing, production, Packing
What will be the result of the following query?
select * from table where department < ‘marketing’;
Answers:
- The query will return “Designing, Packing”
- The query will return “Designing, production, Packing”
- The query will return “packing”
- Strings cannot be compared using < operator
- The query will return “Designing”
Answers:
- Use a RichTextBox object to hold the data as it is being concatenated.
- Use the Append method of the String class.
- Use the String class and the & operator.
- Use the StringBuilder class.
Answers:
- 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 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 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 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
- None of these
Answers:
- MyAdapter.Fill(MyDataSet,”Customer”)
- MyAdapter.Fill(“MyDataSet”,Customer)
- MyAdapter.Fill(MyDataSet)
- MyAdapter.Fill(“MyDataSet”)
1 IN
2 NOT
3 AND
4 OR
Answers:
- 1,2,3,4
- 2,3,4,1
- 1,2,4,3
- 1,4,3,2
- 4,3,2,1
- 4,1,2,3
- 4,2,1,3
- 3,2,1,4
Answers:
- select * from Pers where joining_date from ‘1/1/2005’ to ‘1/2/2005’, job= ‘Analyst’ or ‘clerk’ or ‘salesman’
- select * from Pers where joining_date between ‘1/1/2005’ to ‘1/2/2005’, job= ‘Analyst’ or job= ‘clerk’ or job= ‘salesman’
- select * from Pers where joining_date between ‘1/1/2005’ and ‘1/2/2005’ and (job= ‘Analyst’ or ‘clerk’ or ‘salesman’)
- None of the above
1 select
2 order by
3 where
4 having
5 group by
Answers:
- 1,2,3,4,5
- 1,3,5,4,2
- 1,3,5,2,4
- 1,3,2,5,4
- 1,3,2,4,5
- 1,5,2,3,4
- 1,4,2,3,5
- 1,4,3,2,5
Answers:
- Select * from students where marks > avg(marks);
- Select * from students order by marks where subject = ‘SQL’;
- Select * from students having subject =’SQL’;
- Select name from students group by subject, name;
- Select group(*) from students;
- Select name,avg(marks) from students;
- None of the above
Answers:
- CREATE [UNIQUE] INDEX index_name OF tbl_name (index_columns)
- CREATE [UNIQUE] INDEX OF tbl_name (index_columns)
- CREATE [UNIQUE] INDEX ON tbl_name (index_columns)
- CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns)
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:
- < CertKing Tag:ReportNS PageNumber=”77″ runat=”server” />
- <myReport PageNumber=”77″ src=”rptctrl” runat=”server” />
- < CertKing Tag:myReport PageNumber=”77″ runat=”server” />
- <% Control TagName=”myReport” src=”rptctrl” runat=”server” %>
Answers:
- Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the InitialValue property of the RequiredFieldValidator control to Select.
- Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
- Add a CustomValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
- Add a RegularExpressionValidator control and set its ControlToValidate property to oPaymentTypeList. Set the ValidateExpression property of the RegularExpressionValidator control to Select.
Answers:
- UPDATE Persons SET LastName = ‘Nilsen’ WHERE LastName = ‘Hansen’
- UPDATE Persons SET LastName = ‘Hansen’ INTO LastName = ‘Nilsen’
- SAVE Persons SET LastName = ‘Nilsen’ WHERE LastName = ‘Hansen’
- SAVE Persons SET LastName = ‘Hansen’ INTO LastName = ‘Nilsen’
Answers:
- Create a Microsoft Visual Studio .NET Enterprise template
- Create a sample HTML page
- Create a sample ASP.NET Web form
- Create a cascading style sheet
select (age + 3 * 4 / 2 – 8) from emp
Answers:
- +
- –
- /
- *
Answers:
- Yes
- No
select * from Orders where OrderID = (select OrderID from OrderItems where ItemQty > 50)
Answers:
- In the sub query, ‘*’ should be used instead of ‘OrderID’
- The sub query can return more than one row, so, ‘=’ should be replaced with ‘in’
- The sub query should not be in parenthesis
- None of the above
Answers:
- config.web
- web.config
- sys.config
- config.sys
Answers:
- primary query -> sub query -> sub sub query and so on
- sub sub query -> sub query -> prime query
- the whole query is interpreted at one time
- there is no fixed sequence of interpretation, the query parser takes a decision on the fly
Answers:
- Populate the data objects with data from the database. Populate the controls with values retrieved from the data objects.
- Populate the business objects with data from the database. Populate the controls with values retrieved from the business objects.
- 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
- Bind the controls directly to the database.
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
Answers:
- It will return the fields customer_id, customer_name, branch_name
- It will return the fields customer_id, customer_name, branch_id, branch_name
- It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name
- It will return an empty set since the two tables do not have any common field name
- It will return an error since * is used alone for one table only
Answers:
- A try block can have more than one catch blocks
- Every try block must have a catch block
- Every try block must have a finally block
- All exception classes are to be derived from System.Exception
Answers:
- Create a StateBag object. Use the StateBag object to store the DataSet object in the page’s ViewState property
- 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
- 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
- Use the Session_Start event to create an Application variable of type DataSet for each session. Store the DataSet object in the Application variable
Answers:
- Init
- Load
- Error
- Abort
Answers:
- Yes
- No
Answers:
- Internet Server Application Programming Interface
- Internet Information Server Program
- Webserver interface
- IIS Application
Answers:
- 20
- 25
- 19
- 32
Answers:
- Character
- Binary
- Logical
- Date
- Numeric
- All are supported
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?
Answers:
- SELECT TOP 5 OrderAmount, SalesPersonID FROM orders
- SELECT TOP 5 OrderAmount, SalesPersonID FROM orders ORDER BY OrderAmount DESC
- SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders
- SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders ORDER BY OrderAmount
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:
Answers:
- The transaction will work perfectly fine
- It will report an error
- The error handling routine contains a syntax error
- None of the above
- Both b and c
Answers:
- select * from orders where sum(amount) > 20000
- select * from orders where sum(amount) > 20000 order by OrderDate
- select * from orders group by OrderDate having sum(amount)>20000
- select * from orders group by OrderDate where sum(amount) > 20000
Answers:
- Page_Init
- Page_Load
- Both Page_Init and Page_Load
- Neither in Page_Load nor Page_Init
Answers:
- <add key=”SqlConnect” value=”Data Source=Neptune;Initial Catalog=ClassList;Persist Security Info=True;User ID=xyz;Password=abc”>
- <add key=”SqlConnect” value=”Data Source=ClassList;Initial Catalog=Neptune;Persist Security Info=True;User ID=xyz;Password=abc”>
- <add key=”SqlConnect” value=”Data Source=abc;Initial Catalog=xyz;Persist Security Info=True;User ID=Neptune;Password=ClassList”>
- <add key=”SqlConnect” value=”Data Source=abc;Initial Catalog=xyz;Persist Security Info=True;User ID=ClassList;Password=Neptune”>
<%@ Register tagprefix=”ril” Tagname=”test” Src=”rilTest.ascx” %>
Answers:
- Register a new web site
- Register a new tag
- Register a new user control
- Register a new web page
Answers:
- System.Assembly
- System.Reflection
- System.Collections
- System.Object
Answers:
- Integer, String, and Date
- char, String, and Date
- Integer, String, and varchar
- Integer, bool, and Date
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:
- The two statements produce identical results
- The second statement returns an error
- There is no need to specify DESC because the results are sorted in descending order by default
- None of the above
Answers:
- Add the following element to the authentication section of the Web.config file: <allow users=”?”/>
- Use the Configuration Manager for your project to designate the user’s security context.
- Write code in the Application_AuthenticateRequest event handler to configure the application to run in the user’s security context.
- Add the following element to the system.web section of the Web.config file: <identity impersonate=”true”/>
Employee
———
Empno
Employeename
Salary
Deptno
Department
———
Deptno
Departname
Answers:
- Select departname from department where deptno in (select deptno from employee group by deptno having count(*) > 100);
- Select departname from department where deptno in (select count(*) from employee group by deptno where count(*) > 100);
- Select departname from department where count(deptno) > 100;
- Select departname from department where deptno in (select count(*) from employee where count(*) > 100);
Answers:
- DEFAULT and NOT NULL constraints
- FOREIGN KEY constraints
- PRIMARY KEY and UNIQUE constraints
- IDENTITY columns
- CHECK constraints
- 76. Consider the following two statements and choose the most appropriate option:
2. For configuration, ASP.NET uses an XML based configuration system
Answers:
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answers:
- <ASP:Panel>
- <ASP:Div>
- <ASP:TableCell>
- <ASP:ImageButton>
Answers:
- Functions and Parenthesis
- Multiplication, Division and Exponents
- Addition and Subtraction
- Logical Operations
Answers:
- Detect and redirect
- Use run-time adjustment
- Use satellite assemblies
- Allow the client browser to decide
Each student can enroll into more than one class. Each class can accommodate more than one student.
Answers:
- 1 to N
- 1 to 1
- M to N to 1
- M to N
- N to 1
Answers:
- DataAdapter
- DataReader
- Command
- Connection
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?
Answers:
- SELECT book_title FROM books WHERE price between 500 and 900 AND purchase_date < ’11/11/2002′ ORDER BY purchase_date;
- SELECT book_title FROM books WHERE price IN (500, 900) AND purchase_date< ’11/11/2002′ ORDER BY purchase date ASC;
- SELECT book_title FROM books WHERE price < 500 OR>900 AND purchase_date DESC;
- SELECT Book_title FROM books WHERE (price < 500 OR price > 900) AND purchase_date < ’11/11/2002′ ORDER BY purchase date DESC
You need to modify ProjectCalendar.aspx so that the users need to click the Back button only once. What to do?
Answers:
- Add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response.Expires(0)
- Add the following statement to the Page.Load event handler for ProjectCalendar.aspx: Response.Cache.SetExpires (DateTime.Now())
- Add the following attribute to the Page directive for ProjectCalendar.aspx: EnableViewState=”True”
- Add the following attribute to the Page directive for ProjectCalendar.aspx: SmartNavigation=”True”
Answers:
- For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True.
- In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the
- System.Web.UI.WebControls.Image class.
- In the onmouseover event handler for each image, add code that calls the ToString() method of the
- System.Web.UI.WebControls.Image class.
- For each image, set the ToolTip property to specify the text you want to display.
SELECT name
FROM Student
WHERE name LIKE ‘_a%’;
Which names will be displayed?
Answers:
- Names starting with “a”
- Names containing “a” as the second letter
- Names starting with “a” or “A”
- Names containing “a” as any letter except the first
1 Create table Pers
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:
- 1
- 2
- 3
- 4
- 5
- None
Answers:
- Select * from Products order by CurrentStock,ProductGroup
- Select * from Products order by CurrentStock DESC,ProductGroup
- Select * from Products order by ProductGroup,CurrentStock
- Select * from Products order by ProductGroup,CurrentStock DESC
- None of the above
Answers:
- Garbage collection
- Multiple platform support
- Code verification
- Code access security
Answers:
- Server.GetLastError()
- Exception ex
- Raise Error
- None of above
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:
- Select course from students where count(course) > 5;
- Select course from students where count(*) > 5 group by course;
- Select course from students group by course;
- Select course from students group by course having count(*) > 5;
- Select course from students group by course where count(*) > 5;
- Select course from students where count(group(course)) > 5;
- Select count(course) > 5 from students;
- None of the above
<system.web>
<authorization>
<deny users=”RIL”/>
<allow users=”RIL”/>
</authorization>
</system.web>
Answers:
- The user RIL is first denied and then allowed access
- The user RIL is denied access because the <deny> element takes precedence over the <allow> element
- An error is generated because deny and allow cannot both be assigned to the same user
- Can’t say. It depends on the Windows OS version
Answers:
- Use UNIQUE constraints
- Use PRIMARY KEY constraints
- Use DEFAULT and NOT NULL constraints
- Use FOREIGN KEY constraints
- Use SET constraints
Answers:
- if…else
- if exists
- do…while
- while
- begin…end
Answers:
- Response.Redirect()
- Server.Transfer()
- Server.Execute()
- Page.ProcessRequest()
STUDENT_ID INT
SEMESTER_END DATETIME
GPA FLOAT
Which of the following statements finds the highest Grade Point Average (GPA) per semester?
Answers:
- SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL
- SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL
- SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end
- SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades
- SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL
What should you do?
Answers:
- In the code-behind file for CityList.ascx, add the following line of code: Protected CuCity As DropDownList
- In the code-behind file for Customer.aspx, add the following line of code: Public CuCity As DropDownList
- In the code-behind file for Customer.aspx, add the following line of code: Protected CuCity As DropDownList
- In the code-behind file for CityList.ascx, add the following line of code: Public CuCity As DropDownList
Answers:
- 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.
- Create a new Web Control Library project. Create the toolbar within a Web custom control.
- Add a new Web user control to your ASP.NET project. Create the toolbar within the Web user control.
- 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.
Answers:
- Server-side code
- Use the Browser object’s VBScript or JavaScript properties to test if the browser can run scripts
- Use the Browser object’s Cookies
- Client-side scripts
No comments:
Post a Comment