R4RIN
Articles
Java 8
MCQS
ASP.Net MCQ Quiz Hub
ASP.Net Mcq Question Set 4
Choose a topic to test your knowledge and improve your ASP.Net skills
1. Which property will you set for each RadioButton Control in the group?
Specify the same GroupName for each RadioButton.
Specify the different GroupName for each RadioButton.
Specify the same GroupID for each RadioButton.
Specify the same ID for each RadioButton.
2. Which file contains settings for all .NET application types, such as Windows, Console, ClassLibrary, and Web applications?
Web.config
Machine.config
Global.asax
All of the above
3. Which object data is included in bookmarks and e-mailed URLs?
ViewState
cookies
Query strings
All of the above
4. If you want to validate the email addresses, Social Security numbers, phone numbers, and dates types of data, which validation control will be used?
RegularExpressionValidator
CompareValidator
RequiredFieldValidator
none of the above
5. When should you use the OleDbConnection object?
When connecting to an Oracle database.
When connecting to an Office Access database
When connecting to SQL Server 2000
none of the above
6. In a SQL Statement while working with SqlCommand it returns a single value, at that time which method of Command Object will be used?
ExecuteNonQuery
ExecuteReader
ExecuteScalar
All of the above
7. 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.
Only statement 1 is correct.
Statement 2 and 3 are correct.
Only statement 3 is correct.
All statements are correct.
8. 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+”,”); }
10, 11, 1, 12
10, 11, 12, 13
9, 10, 0, 11
None of these
9. 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); }
7 2 1
9 4 1
3 8 6
1 4 9
10. 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+” “); }
9867 2 0
5411398
54113
none of the above
11. 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+” “); }
0 24568 13578
0 2 4 5 6 8 1 3 7
0 1 2 3 4 5 6 7 8
none of the above
12. 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 +” “); }
0, 2, 4, 5, 6, 8, 9
1, 3, 5, 7, 8
0 2 4 6 9
All of the above
13. Which LINQ statement defines the range variable in a LINQ query?
from
select
join
where
14. Which query expression is used to limit the number of results?
Skip
Take
Where
Select
15. Which interface defines the basic extension methods for LINQ?
IComparable<T>
IList
IEnumerable
IQueryable<T>
16. What LINQ expressions are used to shape results in a query? 1. where 2. select 3. join 4. group
2, 4
1, 2
3, 4
None of the mentioned
17. 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, 2, 4
1, 2, 4
1,2,3
1,3,4
18. Which LINQ statement is used to merge two data sources to perform queries?
where
select
join
group of functions
19. Which LINQ keyword is used to categorize results in a query?
where
select
join
group
20. Which of the following statements is true?
LINQ to SQL works with any database.
LINQ to SQL works with SQL Server.
LINQ to SQL is a CLR feature.
LINQ to SQL is a SQL Server feature.
21. LINQ query can work with?
DataSet
List<T>
Array
All of the above
22. How you can merge the results from two separate LINQ queries into a single result set.
Use the ToList method.
Use the DataContractJsonSerializer class.
Use the XElement class.
Use the Concat method.
23. Which of the following objects represents a LINQ to SQL O / R map?
DataSet
XElement
ObjectContext
DataContext
24. What is lamda expression? 1. Anonymous function 2. Can be used to create delegates 3. Named function 4. None
1, 2
1, 2, 3
1, 3
4
25. Choose the correct one
The lambda must contain the same number of parameters as the delegate type.
The lambda should not contain the same number of parameters as the delegate type.
The return value of the lambda (if any) must be explicitly convertible to the delegate's return type
None of the above
26. Choose the correct one.
The return value of the lambda (if any) must be explicitly convertible to the delegate's return type
Each input parameter in the lambda must be implicitly convertible to its corresponding delegate parameter.
Lamda expression does not work with LINQ.
None of the above
27. Choose the correct one
Variables introduced within a lambda expression are not visible in the outer method.
Variables introduced within a lambda expression are visible in the outer method.
The lambda should not contain the same number of parameters as the delegate type.
None of the above.
28. Choose the correct option.
Dynamic type is non - static type.
Dynamic type is static type.
Implicit conversion does not work with type dynamic.
none of the above
29. Which of the following statement is correct?
Anonymous types are class types that derive directly from object.
Anonymous types are not class types that derive directly from object.
Anonymous types are class types that derive directly from System.Class.
None of the above
30. What types of Objects can you query using LINQ?
DataTables and DataSets
Any .NET Framework collection that implements IEnumerable(T)
. Collections that implement interfaces that inherit from IEnumerable(T)
All of the above
31. When do LINQ queries actually run?
When they are iterated over in a foreachloop
When calling the ToArray() method on the range variable
When calling the ToList() method on the range variable
All of the above
32. Which of the following statement / s is / are true?
CommitChanges is a method of SqlDataContext.
CommitChanges is a method of DataContext.
CommitChanges is a method of DbDataContext.
CommitChanges is a method of OleDbData Context
33. An interface can contain declaration of?
Methods, properties, events, indexers
Methods
Static members
All of the above
34. 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.
3,4,5
1,2,3
2,3,4
All of the above
35. 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,3,4
1,2,3
2,3,4
All of the above
36. Properties in .NET can be declare as 1. Static, Protected internal, Virtual 2. Public, internal, Protected internal 3. Only public 4. None
1, 2
3
1, 2, 3
4
37. 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, 2
3
1,2,3
none of the above
38. The best way for handling exception when dealing with a database connection?
Implement a try / catch block that catches System.Exceptions.
Implementing custom error page.
Implement a try / catch block that catches individual exception types, such as SQLException.
Display an error message.
39. For building new types at runtime which class can be used?
System
System.Object
System.NewClass
System.Reflection.Emit.
40. Reflection can be used when?
To access attributes in your program's metadata
To create type at compile time
To access attributes at compile time.
None of the above
41. 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?
OrderedDictionary class
HybridDictionary class
ListDictionary class
Hashtable class
42. 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?
System.UInt16
int
System.String
System.IntPtr
43. Which of the following is dictionary object?
HashTable
SortedList
NameValueCollection
All of the above
44. 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.
<authorization> <deny users=”ABC”> <allow users=”*”> <deny users=”?”> </authorization>
<authorization> <allow users=”*”> <deny users=”ABC”> <deny users=”?”> </authorization>
<authorization> <allow users=”ABC”> <allow users=”*”> </authorization>
<authorization> <deny users=”ABC”> <deny users=”?”> <allow users=”*”> </authorization>
45. An assembly must have an permission to connect with web server is?
socketPermission
DnsPermission
WebPermission
TCPPermission
46. Thread class has the following property. A. ManagedThreadID B. IsBackground C. IsBackgroundColor D. Abort
1, 2
1, 4
4
1 ,2, 4
47. Which delegate is required to start a thread with one parameter?
ThreadStart
ParameterizedThreadStart
ThreadStartWithOneParameter
none of the above
48. For locking the data with synchronization which class will be used?
Moniter
SyncLock
Moniter
Deadlock
49. How many readers can simultaneously read data with ReaderWriterLock if there is no writer locks apply?
9
11
13
No Limit
50. Which of the following are value types?
String
System .Value
System.Drawing
System.Drawing.Point
Submit