Вы находитесь на странице: 1из 7

M4.1-R4: APPLICATION OF .NET TECHNOLOGY NOTE: 1. There are TWO PARTS in this Module/Paper.

PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF ANSWER SHEET only, attached to the question paper, as per the instructions contained therein. PART ONE is NOT to be answered in the answer book.

3.

Maximum time allotted for PART ONE is ONE HOUR. Answer book for PART TWO will be supplied at the table when the answer sheet for PART ONE is returned. However, candidates, who complete PART ONE earlier than one hour, can collect the answer book for PART TWO immediately after handing over the answer sheet for PART ONE. TOTAL TIME: 3 HOURS TOTAL MARKS: 100 (PART ONE 40; PART TWO 60) PART ONE (Answer all the questions) 1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the tear-off answer sheet attached to the question paper, following instructions therein. (1x10) In C#, a statement a ? b : c means If a is true, returns the value of b, otherwise c If b is true, returns the value of a, otherwise c If a is true, returns the value of c, otherwise b If c is true, returns the value of b, otherwise a In C#, a statement a ?? b means If a is null and b is null, returns a If a is null, returns a, otherwise returns b If a is null, returns b, otherwise returns a None of the above In C# and VB.Net can you store multiple data types in System.Array? No Yes Cant say None of the above What is the role of the DataReader class in ADO.NET connections? It does not return a dataset from the data source when the command is executed It only can return a read-only dataset from the data source when the command is executed It does both, store and return a read-only dataset from the data source when the command is executed None of the above

1.1 A) B) C) D) 1.2 A) B) C) D) 1.3 A) B) C) D) 1.4 A) B) C) D)

M4.1-R4 (New)

Page 1 of 7

July, 2010

1.5 A) B) C) D) 1.6 A) B) C) D) 1.7 A) B) C) D) 1.8 A) B) C) D) 1.9

What are the ways to deploy an assembly? A MSI installer A CAB archive A XCOPY command All of the above If a method is marked as protected internal who can access it? Classes that are both in the same assembly and derived from the declaring class. Only methods that are in the same class as the method in question. Internal methods can only be called using reflection. Classes within the same assembly and classes derived from the declaring class. What is boxing? Encapsulating an object in a value type. Encapsulating a copy of an object in a value type. Encapsulating a copy of a value type in an object. Encapsulating a value type in an object. What is a delegate? A delegate is an object that represents a method and a strongly typed function pointer. A light weight thread or process that can call a single method. A reference to an object in a different process. An inter-process message channel. Which design pattern is shown below? public class X { private X instance; private X() { } Public static X Instance { get { if ( X == null ) X = new X(); return instance; } } }

A) B) C) D) 1.10 A) B) C) D)

Factory Abstract Factory Singleton Builder Which of the following operations you can NOT perform on an ADO.NET Data set? A Data Set can be synchronized with the database. A Data Set can be synchronized with a Record Set. A Data Set can be converted to XML. You can infer the schema from a Data Set.

M4.1-R4 (New)

Page 2 of 7

July, 2010

2.

Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the tear-off sheet attached to the question paper, following instructions therein. (1x10) A compiler switch /text creates an xml file from the xml comments in the files in an assembly. In C#, following three assignment statements are equivalent. month = month +1; month + = 1; month ++; In ASP.Net fragment caching refers to the caching of individual user controls within a web Form. A stack is a LIFO (Last In - First Out) collection. Only the last item is accessible at any time, and items can only be put at the top. A list is a static array which does not resize itself as needed if more data is inserted than it can hold at the time of insertion. Debugging tools CorDBG command-line debugger, and DbgCLR graphic debugger, come with the .NET SDK. To use CorDBG, one must compile the original C# file using the /debug switch. All .NET languages have the same primitive data types. For example an int in C# is the same as an int in VB.NET. In VB.NET programming language, the default size of Integer data type is 16 bits. As XML is case-sensitive, so <Student> and <student> are different elements. The operator + = can be used to write an event to the delegate. Match words and phrases in column X with the closest related meaning/ word(s)/phrase(s) in column Y. Enter your selection in the tear-off answer sheet attached to the question paper, following instructions therein. (1x10) X Y A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. // al.exe Relational Operator .NET framework xsd.exe Logical Operator System.data.dll System.Data.Common ODBC ObjectSpace System.Data.OleDb object Size Capacity csc.exe

2.1 2.2

2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 3.

3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10

ADO.NET is the primary data access API Operator = = Single Line Comments Assembly Generation Utility XML Schema definition tool Assembly Operator && System Namespace Class for communication with the data source The number of elements the ArrayList can hold

M4.1-R4 (New)

Page 3 of 7

July, 2010

4.

Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the tear-off answer sheet attached to the question paper, following instructions therein. (1x10) http object class .Net Runtime removes all binary hardware B. E. H. K. N. Q. T. break & continue NameSpaces .Net application object continue ADO.NET first time C. F. I. L. O. R. interfaces FIFO memory end XML OledbConnection

A. D. G. J. M. P. S. 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10

A queue is a ________ collection and only the first item is accessible at any time, and any item can only be put to the end of the queue. Record set cannot be transmitted on ________. MSIL (Microsoft Intermediate Language) Code is ________ independent. Sole purpose of using ________ is to prevent name conflicts and resolves any ambiguity for the C# compiler. Use ________ in C# loops to change the normal execution path. Structures (struct) in C# can only inherit (or implement) ________. In C# (and the .Net Framework) all the types (classes, structures, and interfaces) are implicitly inherited from the ________ defined in the System NameSpace. Garbage Collection in .Net in invoked by the ________ at regular intervals using System.GC.Collect ( ) method and removes the dirty objects from the memory. ASP.NET is a part of the framework for developing ________. ADO.NET and .NET data providers make connection pooling mostly transparent to developers and ________ establishes a link with a data source via an OLE DB provider.

M4.1-R4 (New)

Page 4 of 7

July, 2010

PART TWO (Answer any FOUR Questions) 5. a) b) c) What is ADO.NET? Explain, how while and Do.While loop operates? Analyze the following code and give answer: using system; public static void Main ( ) { // declaring and initializing an array of type integer int [ ] integers = {8, 6, 2, 15, 43, 7}; // iterating through the arry and printing each element For ( int i = 0; i<5; i++) { integers [i] = 2 * integer [i+1] + 5; Console.WriteLine ( integers [ ] ); } } i) Is Console.WriteLine( ) a method or a class ? If WriteLine( ) is a method, then specify its type and the class to which it belongs. If WriteLine( ) is a class, then explain, why it is a class? ii) Operator [ ] is known as which operator in C#? iii) Give the output of the above code. (3+6+6) Give the output of the following code with justification. using system; public class DoWorkTest { public static void Main ( ) { // declaring and initializing of type integer int p = 3; DoWork (p) ; console.WriteLine ( The value of p is + p ); // printing the value of p } public static void DoWork ( int i) { i++; } } What is ID selector in ASP.Net? i) How to declare and initialize a variable in one statement using C# syntax? ii) How do you use CSS file in ASP.Net?

6. a)

b) c)

M4.1-R4 (New)

Page 5 of 7

July, 2010

d)

The following code snippet adds a new record to the in-memory database. Assume da to be the SqlDataAdapter reference, ds to be the Dataset reference and dt to be the Data Table reference. Add the missing statement to the code. DataRow r; r=dt.NewRow(); r(0)=accno; r(1)=accname; r(2)=balance; // Add missing statement here da.Update(ds, acc); (3+5+4+3) How to use ADO.NET with datasets? Explain with examples i) Explain the purpose of break statement in the following code. using system; public class BreakTest { For (int i=1; i<=10; i++) { if ( i < 5 ) { break; } Console.writeLine (in the loop, value of i is {0}., i); } } ii) Give the output of the following code. using system; public class ContinueTest { For (int i=1; i<=10; i++) { if ( i = = 5 ) { continue; } Console.writeLine (in the loop, value of i is {0}., i); } } Write a program using VB.Net programming syntax to test whether two given strings are equal. (6+4+5) i) ii) What is the basic difference between Dataset.Clone and Dataset.Copy? What is the difference between Clear ( ) method and Remove (object) of the ArrayList class?

7. a) b)

c)

8. a)

M4.1-R4 (New)

Page 6 of 7

July, 2010

b)

Write short notes (on any two) of the following: i) .NET Framework ii) Exception hierarchy in the .Net Framework iii) Using ADO.NET without using datasets (5+[2x5])

9. a) b) c)

Briefly explain the fundamentals of connection pooling? What is method overloading? Explain with proper example. Identify and explain the error in the following code. using system; public class ForTest { For (int i=1; i<=10; i++) { Console.writeLine (in the loop, value of i is {0}.,i); } i+ +; // line1 } (5+6+4)

M4.1-R4 (New)

Page 7 of 7

July, 2010

Вам также может понравиться