MCQs | ASP.Net/ASP.Net Mcq Question Set 4 Sample Test,Sample questions

Question:
Choose the correct option.

1. Dynamic type is non - static type.

2. Dynamic type is static type.

3.Implicit conversion does not work with type dynamic.

4.none of the above


Question:
LINQ query can work with?

1.DataSet

2. List<T>

3.Array

4.All of the above


Question:
When should you use the OleDbConnection object?

1. When connecting to an Oracle database.

2.When connecting to an Office Access database

3.When connecting to SQL Server 2000

4.none of the above


Question:
An interface can contain declaration of?

1. Methods, properties, events, indexers

2.Methods

3.Static members

4.All of the above


Question:
Choose the correct one

1. The lambda must contain the same number of parameters as the delegate type.

2.The lambda should not contain the same number of parameters as the delegate type.

3.The return value of the lambda (if any) must be explicitly convertible to the delegate's return type

4.None of the above


Question:
Choose the correct one.  

int[] numbers = { 5, 4, 11, 3, 9, 8, 6, 7, 2, 0 };  
  
    var nums = numbers.Skip(4);    
  
    foreach (var n in nums)   
    {   
        Console.Write(n+”  “);   
    }

1.9867 2 0

2. 5411398

3.54113

4.none of the above


Question:
Choose the correct one.  

int[] numbers = { 9, 10, 0, 11 };
  
        var nums =
        from n in numbers
        select n + 1;
  
    foreach (var i in nums)
    {
        Console. Write (i+”,”);
    }

1.10, 11, 1, 12

2.10, 11, 12, 13

3. 9, 10, 0, 11

4. None of these


Question:
Choose the correct one.

1.The return value of the lambda (if any) must be explicitly convertible to the delegate's return type

2.Each input parameter in the lambda must be implicitly convertible to its corresponding delegate parameter.

3.Lamda expression does not work with LINQ.

4.None of the above


Question:
For building new types at runtime which class can be used?

1.System

2.System.Object

3. System.NewClass

4.System.Reflection.Emit.


Question:
How many readers can simultaneously read data with ReaderWriterLock if there is no writer locks apply?

1.9

2.11

3.13

4.No Limit


Question:
How you can merge the results from two separate LINQ queries into a single result set.

1.Use the ToList method.

2. Use the DataContractJsonSerializer class.

3. Use the XElement class.

4.Use the Concat method.


Question:
Properties in .NET can be declare as

1. Static, Protected internal, Virtual
2. Public, internal, Protected internal
3. Only public
4. None

1.1, 2

2.3

3.1, 2, 3

4.4


Question:
Reflection can be used when?

1. To access attributes in your program's metadata

2.To create type at compile time

3.To access attributes at compile time.

4. None of the above


Question:
What LINQ expressions are used to shape results in a query?

1. where
2. select
3. join
4. group

1.2, 4

2. 1, 2

3.3, 4

4.None of the mentioned


Question:
When do LINQ queries actually run?

1.When they are iterated over in a foreachloop

2.When calling the ToArray() method on the range variable

3.When calling the ToList() method on the range variable

4.All of the above


Question:
Which interface defines the basic extension methods for LINQ?

1. IComparable<T>

2.IList

3.IEnumerable

4.IQueryable<T>


Question:
Which LINQ keyword is used to categorize results in a query?

1. where

2.select

3. join

4. group


Question:
Which of the following are correct?

1. An interface can be instantiated directly.
2. Interfaces can contain constructor.
3. Interfaces contain no implementation of methods.
4. Classes and structs can implement more than one interface.
5. An interface itself can inherit from multiple interfaces.

1. 3,4,5

2.1,2,3

3.2,3,4

4.All of the above


Question:
Which of the following are correct?

1. Delegates are like C++ function pointers.
2. Delegates allow methods to be passed as parameters.
3. Delegates can be used to define callback methods.
4. Delegates are not type safe.

1. 1,3,4

2. 1,2,3

3. 2,3,4

4.All of the above


Question:
Which of the following are value types?

1.String

2.System .Value

3.System.Drawing

4. System.Drawing.Point


Question:
Which of the following objects represents a LINQ to SQL O / R map?

1. DataSet

2.XElement

3.ObjectContext

4. DataContext


Question:
Which of the following statements are correct?

1. Indexers enable objects to be indexed in a similar manner to arrays.
2. The this keyword is used to define the indexers.
3. Indexers can be overloaded.
4. Indexer cannot be used in interface

1. 1, 2

2. 3

3.1,2,3

4.none of the above


Question:
Which query expression is used to limit the number of results?

1.Skip

2.Take

3.Where

4.Select


Question:
According to the given below statements, choose the correct option.

Statement 1: Application caching is the process of storing data (and not pages) in a cache object.
Statement 2: Page output caching stores a rendered page, portion of a page, or version of a page in memory.
Statement 3: Caching reduces the time required to render cached page in future requests.

1.Only statement 1 is correct.

2.Statement 2 and 3 are correct.

3.Only statement 3 is correct.

4.All statements are correct.


Question:
An assembly must have an permission to connect with web server is?

1.socketPermission

2.DnsPermission

3. WebPermission

4.TCPPermission


Question:
Choose the correct one

1.Variables introduced within a lambda expression are not visible in the outer method.

2.Variables introduced within a lambda expression are visible in the outer method.

3. The lambda should not contain the same number of parameters as the delegate type.

4.None of the above.


Question:
Choose the correct one.

int[] numbers = { 9, 4, 1, 3, 8, 6, 7, 2,1 };
  
    var nums = numbers.Take(3);  
  
    foreach (var n in nums)   
    {
  
        Console.WriteLine(n);
  
    }

1.7 2 1

2.9 4 1

3.3 8 6

4.1 4 9


Question:
Choose the correct one.  

int[] A = { 0, 2, 4, 5, 6, 8 };
        int[] B = { 1, 3, 5, 7, 8 };
  
        var nums = A.Union(B);   
   
    foreach (var n in nums)
    {
        Console.Write(n+”  “);
    }

1. 0 24568 13578

2.0 2 4 5 6 8 1 3 7

3.0 1 2 3 4 5 6 7 8

4.none of the above


Question:
Choose the correct one.  

int[] A = { 0, 2, 4, 5, 6, 8, 9 };
    int[] B = { 1, 3, 5, 7, 8 };
  
    IEnumerable nums = A.Except(B);
  
    foreach (var n in nums)
    {
        Console.Write(n +”  “);
    }

1.0, 2, 4, 5, 6, 8, 9

2.1, 3, 5, 7, 8

3. 0 2 4 6 9

4.All of the above


Question:
For locking the data with synchronization which class will be used?

1.Moniter

2.SyncLock

3. Moniter

4.Deadlock


Question:
If you want to validate the email addresses, Social Security numbers, phone numbers, and dates types of data, which validation control will be used?

1.RegularExpressionValidator

2. CompareValidator

3.RequiredFieldValidator

4.none of the above


Question:
In a SQL Statement while working with SqlCommand it returns a single value, at that time which method of Command Object will be used?

1. ExecuteNonQuery

2.ExecuteReader

3.ExecuteScalar

4.All of the above


Question:
The best way for handling exception when dealing with a database connection?

1. Implement a try / catch block that catches System.Exceptions.

2. Implementing custom error page.

3. Implement a try / catch block that catches individual exception types, such as SQLException.

4.Display an error message.


Question:
Thread class has the following property.

A. ManagedThreadID
B. IsBackground
C. IsBackgroundColor
D. Abort

1. 1, 2

2.1, 4

3.4

4.1 ,2, 4


Question:
What is lamda expression?

1. Anonymous function
2. Can  be used to create delegates
3. Named function
4. None

1.1, 2

2.1, 2, 3

3.1, 3

4. 4


Question:
What types of Objects can you query using LINQ?

1.DataTables and DataSets

2. Any .NET Framework collection that implements IEnumerable(T)

3.. Collections that implement interfaces that inherit from IEnumerable(T)

4.All of the above


Question:
What types of shapes can LINQ query results be shaped into?

1. Collections of primitive types
2. Collections of complex types
3. Single types
4. Collections of anonymous types

1.1, 2, 4

2.1, 2, 4

3.1,2,3

4.1,3,4


Question:
Which delegate is required to start a thread with one parameter?

1.ThreadStart

2. ParameterizedThreadStart

3.ThreadStartWithOneParameter

4.none of the above


Question:
Which file contains settings for all .NET application types, such as Windows, Console, ClassLibrary, and Web applications?

1.Web.config

2.Machine.config

3.Global.asax

4.All of the above


Question:
Which LINQ statement defines the range variable in a LINQ query?

1.from

2.select

3. join

4.where


Question:
Which LINQ statement is used to merge two data sources to perform queries?

1.where

2.select

3. join

4.group of functions


Question:
Which object data is included in bookmarks and e-mailed URLs?

1.ViewState

2.cookies

3.Query strings

4. All of the above


Question:
Which of the following is dictionary object?

1.HashTable

2. SortedList

3.NameValueCollection

4.All of the above


Question:
Which of the following statement / s is / are true?

1.CommitChanges is a method of SqlDataContext.

2. CommitChanges is a method of DataContext.

3. CommitChanges is a method of DbDataContext.

4.CommitChanges is a method of OleDbData Context


Question:
Which of the following statement is correct?

1.Anonymous types are class types that derive directly from object.

2.Anonymous types are not class types that derive directly from object.

3.Anonymous types are class types that derive directly from System.Class.

4.None of the above


Question:
Which of the following statements is true?

1.LINQ to SQL works with any database.

2.LINQ to SQL works with SQL Server.

3.LINQ to SQL is a CLR feature.

4.LINQ to SQL is a SQL Server feature.


Question:
Which property will you set for each RadioButton Control in the group?

1.Specify the same GroupName for each RadioButton.

2.Specify the different GroupName for each RadioButton.

3.Specify the same GroupID for each RadioButton.

4.Specify the same ID for each RadioButton.


Question:
You need to identify a type that meets the following criteria:

• Is always a number.
• Is not greater than 65,535.

Which type should you choose?

1. System.UInt16

2. int

3. System.String

4.System.IntPtr


Question:
You need to select a class that is optimized for key - based item retrieval from both small and large collections. Which class should you choose?

1.OrderedDictionary class

2.HybridDictionary class

3.ListDictionary class

4.Hashtable class


Question:
You want to configure the application to use the following authorization rules in web.config file.

• Anonymous users must not be allowed to access the application.
• All employees except ABC must be allowed to access the application.

1.<authorization> <deny users=”ABC”> <allow users=”*”> <deny users=”?”> </authorization>

2.<authorization> <allow users=”*”> <deny users=”ABC”> <deny users=”?”> </authorization>

3.<authorization> <allow users=”ABC”> <allow users=”*”> </authorization>

4.<authorization> <deny users=”ABC”> <deny users=”?”> <allow users=”*”> </authorization>


More MCQS

  1. ASP.Net Mcq Question Set 1
  2. ASP.Net Mcq Question Set 2
  3. ASP.Net Mcq Question Set 3
  4. ASP.Net Mcq Question Set 4
  5. ASP.Net Mcq Question Set 5
  6. ASP.Net Mcq Question Set 6
  7. ASP.Net Mcq Question Set 7
  8. ASP.Net Mcq Question Set 8
  9. ASP.Net Mcq Question Set 9
  10. ASP.Net Mcq Question Set 10
  11. ASP.Net Mcq Question Set 11
  12. ASP.Net Mcq Question Set 12
  13. ASP.Net Mcq Question Set 13
  14. ASP.Net Mcq Question Set 14
Search