R4RIN
Articles
Java 8
MCQS
.NET Micro Framework MCQ Quiz Hub
.NET MCQ Set 3
Choose a topic to test your knowledge and improve your .NET Micro Framework skills
1. Considering the image, which of the following is the correct syntax for encoding a particular string in .Net framework 4.0?
Only a
Only b
Both a and b
None of These
2. How do you add MetaDescription to your web page in .Net framework 4.0? HtmlMeta meta2 = new HtmlMeta(); meta2.Name = "description";meta2.Content = "add meta description";Page.Header.Controls.Add(HtmlMeta );
Page.MetaDescription
Both a and b are correct.
Both a and b are correct.
None of the above.
3. How will you implement the logic for the following scenario in .Net framework 4.0? Suppose you have a GridView with paging enabled. You select the third row on page 1 and then move to page 2. Nothing is selected on page 2. When you move back to page 1, the third row should still be selected.
Set the GridView DataKeyNames property.
Set the GridView EnablePersistedSelection property to true.
Set the Gridview PagerSettings-Mode property.
It is not possible to implement the given logic for the scenario described above.
4. In WCF, what is the significance of the ReceiveRetryCount property of a Poison message in .Net framework 4.0?
It is an integer value that indicates the maximum number of times to retry delivery of a message from the application queue to the application.
It is an integer value that indicates the maximum number of retry cycles.
It is the time delay between retry cycles.
None of these
5. What is the purpose of the System.Windows.Data namespace in .Net framework 4.0?
Using System.Windows.Data namespace, you can integrate rich media, including drawings, text, and audio/video content in Windows Presentation Foundation applications.
It contains classes used for binding properties to data sources, data source provider classes, and data-specific implementations of collections and views.
It provides the types that support navigation, including navigating between windows and navigation journaling.
It contains classes for creating windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows operating system.
6. How will you count the odd numbers from the array shown below using LINQ in .Net framework 4.0? int[]numbers={5,4,1,3,9,8,6,7,2,0};
int findoddNumbers = numbers.Count(n => n % 2 == 1);
int findoddNumbers = numbers.Count( n % 2 == 1);<br><br>
int findoddNumbers = (from number in numbers<br>where numbers%2==1<br>select Count());<br><br>
https://quizack.com/net/mcq/how-will-you-count-the-odd-numbers-from-the-array-shown-below-using-linq-in-net-framework-4-0-int-numbers-5-4-1-3-9-8-6-7-2-0#:~:text=int%20findoddNumbers%20%3D%20(from%20n
7. Which of the following is the correct way to expand the size of application URLs in .Net framework 4.0?
<httpModules maxRequestPathLength="260" maxQueryStringLength="2048" />
<httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" />
<httpHandlers maxRequestPathLength="260" maxQueryStringLength="2048" />
None of the above
8. Which of the following statements is correct for the bubbling routing strategies used by the routing events in WPF in .Net framework 4.0?
This event is first raised on the root, then on each element down the tree until the source element is reached.
This event is only raised on the source element. It will have the same behavior as a plain .NET event, except that such events can still participate in mechanisms specific to routed events such as eve
This event is first raised on the source element, then on each element up the tree until the root is reached.
None of the above
9. Which of the following arrays will be returned as result when you run the following LINQ query in .Net framework 4.0? object[] varnumbers = { null, 1.0, "two", 3, "four", 5, "six", 7.0 }; var doubles = varnumbers.OfType<double>(); foreach (var d in doubles) { Response.Write(d); }
1, 7
null
two, four, six
null, 1.0, &quot;two&quot;, 3, &quot;four&quot;, 5, &quot;six&quot;, 7.0
10. Which of the following pieces of information is provided by the WCF service contract in .Net framework 4.0?
The grouping of operations in a service.
The location of the operations.
The specific protocols and serialization formats that are used to support successful communication with the service.
All of the above
11. Which of the following is NOT a valid data source control in .Net framework 4.0?
XmlDataSource
AccessDataSource
EntityDataSource
All of the above are valid data sources
12. How many columns can you select by $orderby OData system query option in .Net Framework 4.0?
5
12
20
infinite
13. Suppose your site has a page called Index.aspx that you no longer use. Search engines may keep requesting this page. Which of the following method will you add to the CodeBehind file of Index.aspx that will send requests (including search engine requests) to Default.aspx in .Net framework 4.0?
Server.Transfer
Response.Redirect
Response.RedirectPermanent
Server.Execute
14. Which of the following statements is correct for WSHttpBinding of WCF in .Net framework 4.0?
It is a secure and interoperable binding that is suitable for non-duplex service contracts.
It is a secure and interoperable binding that is suitable for duplex service contracts or communication through SOAP intermediaries.
It is a secure and optimized binding suitable for cross-machine communication between WCF applications.
It is a queued binding that is suitable for cross-machine communication between WCF applications.
15. Which of the following OData system query options is used to determine the maximum number of records to be returned in .Net framework 4.0?
$top
$filter
$select
$expand
16. How will you display the view data in the view of an ASP.NET MVC Application?
%: ViewData[&quot;CurrentTime&quot;] %&amp;gt;
&amp;lt;%=ViewData[&quot;CurrentTime&quot;] %&amp;gt;
%ViewData[&quot;CurrentTime&quot;] %
&amp;lt;ViewData[&quot;CurrentTime&quot;] &amp;gt;
17. Which of the following is NOT a valid QueryExtender filter option in .Net framework 4.0?
SearchExpression
RangeExpression
OrderByExpression
All of the above are valid QueryExtender filter options
18. Which of the following statements is correct for ASP.NET MVC Routing in .Net Framework 4.0?
It is used to match the incoming requests and to map them to a controller action.
It is used to construct the outgoing URLs which correspond to controller actions.
Both a and b are correct.
None of These
19. What result will you get when you run the following LINQ query in .Net framework 4.0? var scoreRecords = new[] { new {Name = "Alice", Score = 50}, new {Name = "Bob" , Score = 40}, new {Name = "Cathy", Score = 45} }; var scoreRecordsDict = scoreRecords.ToDictionary(sr =>sr.Name); Response.Write(scoreRecordsDict["Bob"]);
{ Name = Bob}
{ Name = Bob, Score = 40 }
Name = Bob
None of the above
20. What is a Decorator in WPF of .Net framework 4.0?
It is used to add functional handles to elements or provide state information about a control.
It is the base class for elements that apply effects onto or around a single child element, such as Border or Viewbox.
It provides a set of services that can be used to extend the functionality of a common language runtime property.
It is a property with the exception that its value cannot be set outside the class that declared the read-only property.
21. What is default format used to represent data returned in an ADO.NET Data Services response in .Net framework 4.0?
XAML
SOAP
Atom
WSDL
22. What is DLR in .Net framework 4.0?
It defines the common types that are supported by the languages which are compatible with the .Net framework.
It represents the data types of different languages in a specific format specification.
It is a programming language that manages the execution of programs written in any of several supported languages, allowing them to share common object-oriented classes written in any of the languages
It is a runtime environment that adds a set of services for dynamic languages to the common language runtime.
23. How is data passed from controllers to views in an ASP.NET MVC Application?
Using ViewData
Using ViewState
Using Sessions
Using Cookies
24. Which of the following classes of System.Windows.Media namespace provides rendering support in WPF which includes hit testing, coordinate transformation, and bounding box calculations in .Net framework 4.0?
HitTestResult
Visual
Colors
Brush
25. How can you determine, at runtime, if your application is running in the 64-bit version of .Net framework 4.0?
Check IntPtr.Size property for a value of 8.
Call the Environment.GetEnvironmentVariable method and pass in the string &quot;Platform&quot; as an argument. Check for a return value of &quot;x64&quot;.
Call the WOW64 emulator method Isx64() and check the boolean return value.&lt;br&gt;
None of the above
26. Which of the following ASP.NET MVC namespaces includes the classes that support forms, input controls, links, partial views, and validation in .Net Framework 4.0?
System.Web.Mvc
System.Web.Mvc.Async
System.Web.Mvc.Html
System.Web.Mvc.Sync
27. Which of the following is NOT a valid WPF Localizability attribute in .Net framework 4.0?
Readability
Modifiability
Category
All of the above are Localizability attributes
28. What result will you get when you run the following LINQ query in .Net framework 4.0? List<string> alphabets = new List<string>() { "whats", "new", "in", "aspnet" }; var alphabetsquery = from alphabet in alphabets select alphabet.Substring(0, 1); foreach (var alpha in alphabetsquery) { Response.Write(alpha); }
wina
whats
whatsnewinaspnet
aspnetinnewwhats
29. What is the function of WCF Data contracts in .Net framework 4.0?
They define, for each parameter or return type, what data is serialized to be exchanged.
They define which operations the client can perform on the service.
They define which errors are raised by the service, and how the service handles and propagates errors to its clients.&lt;br
None of These
30. Which of the following are included in a Static assembly?
Modules
Type metadata
MSIL code
Assembly manifest
31. Which of the following are correct about delegates?
A delegate is an object that refers to a subroutine, function or other method
A delegate variable acts as a pointer to a subroutine or function
A delegate can not hold the address of a class&#039;s shared method
Delegate variables are sometimes called type-safe function pointers
32. Which of the following protocols can be used for .Net Remoting?
TCP
HTTP
SMTP
All of the above
33. Which of the following is correct for value and reference types in .NET?
Value types directly contain their data
Reference types store a reference to the value&#039;s memory address
Value types can be built-in but can&#039;t be user-defined
All of the above
34. Which of these are runtime hosts in .Net Framework?
CLR
IE
IIS .
ASP NET
35. Which of the following run In-Process?
EXE file
Resx file
DLL file
OCX file
36. A manifest includes the following data about the assembly
File list
None Referenced assemblies
MSIL information
None of these
37. The Process of automatic memory management involves the following tasks:
Allocating memory
Registering memory
Implementing finalizers
Using destroy
38. A standard Windows PE file is divided into a number of sections. Which of the following are not valid native image sections?
textdata
data
rpdata
rsrc
39. Which of the following statements is true?
You can access managed data from managed code
You can access managed data from managed and unmanaged code
Managed code can access both managed and unmanaged data
Managed code cannot access both managed and unmanaged data
40. Which of the following methods are used to stop a thread?
Thread.Interrupt()
Thread.Suspend()
Thread.Sleep()
Thread.Abort()
41. ___________ class grants the permission to manipulate files located in the code assemblies, to code assemblies that match the membership condition.
FileCodeGroup
FirstMatchCodeGroup
CodeFileGroup
CodeGroup
42. Which of the following protocols can be used for ASP.Net Web Services?
TCP
HTTP
SMTP
All of the above
43. When are AssemblyHash values used?
They are used throughout the common language runtime to detect a change in assembly contents
They are used in the Common type system for type safety
They are used to change the metadata information in assemblies
None of These
44. In.NET generics, the type parameter:
Needs to be constrained in container classes
Needs to be constrained in all the classes
Cannot be constrained in container classes
Cannot be constrained in any class
45. How many classes can a single .NET DLL contain?
10
20
Unlimited
5
46. Where is the Shared assembly generally stored?
Application&#039;s directory
Global assembly cache
C drive
None of the above
47. Which of the following is not correct with regard to shared assembly?
Its version can be controlled by the author only
It can be shared by many applications
It must get registered with the machine registry
It is installed in the global assembly cache
48. Which Portable Executable (PE) file does not contain the assembly manifest?
Executable
DLL
Module
ALL
49. In .NET framework, what are the options available for packaging?
CAB
EXE
MSI
All of the above
50. Which of the following are public methods of System.Object?
GetHashCode()
GetType()
Equals()
All of the above
51. Which of the following helps expose COM components to the .NET framework?
RCW✖
CCA
CWA
CCW
52. Which of the following tools can be used to get the metadata information about the assembly and view IL code?
soapsuds.exe
lldasm.exe
al.exe✖
PerfMon.
53. Which of the following tools assists Assembly Signing?
CASPol.exe
PerfMon.exe
SN.exe
soapsuds.exe
54. In which file can you define the "Process Model" attribute?
Web.config
Machine.config
In both files
In neither file
55. C# has a keyword called int. Which .NET type does this map to?
System.Int16
System.Int32
System.Int64
System.Int128
Submit