Software job search
.net sql interview questions
  The best place for technical interview questions

 
Home.netSql serverAsp.netC#Vb.netAdo.netAjaxMcpd dumpsWord count tool
MCPD practice exams - 70-536 - Microsoft .NET Framework 2.0 - Application Development Foundation Exam B - question 348
MCPD - 70-536 - Microsoft .NET Framework 2.0 - Application Development Foundation Exam B - question no 348
Question. You are testing a newly developed method named PersistToDB. This method accepts a parameter of type
EventLogEntry.
This method does not return a value. You need to create a code segment that helps you to test the method.
The code segment must read entries from the application log of local computers and then pass the entries
on to the PersistToDB method.
The code block must pass only events of type Error or Warning from the source MySource to the
PersistToDB method.
Which code segment should you use?
   







A. Dim myLog As New EventLog("Application", ".")
For Each entry As EventLogEntry In myLog.Entries
If entry.Source = "MySource" Then
PersistToDB(entry)
End If
Next
B. Dim myLog As New EventLog("Application", ".")
myLog.Source = "MySource"
For Each entry As EventLogEntry In myLog.Entries
If entry.EntryType = (EventLogEntryType.[Error] And EventLogEntryType.Warning) Then
PersistToDB(entry)
End If
Next
C. Dim myLog As New EventLog("Application", ".")
For Each entry As EventLogEntry In myLog.Entries
If entry.Source = "MySource" Then
If entry.EntryType = EventLogEntryType.[Error] OrElse entry.EntryType = EventLogEntryType.
Warning Then
PersistToDB(entry)
End If
End If
Next
D. Dim myLog As New EventLog("Application", ".")
myLog.Source = "MySource"
For Each entry As EventLogEntry In myLog.Entries
If entry.EntryType = EventLogEntryType.[Error] OrElse entry.EntryType = EventLogEntryType.
Warning Then
PersistToDB(entry)
End If
Next
 Rate this question
     
 40 votes , average 3 out of 5

Next Question


Reader's opinions -

No comments
Loading

 
.net interview questions
Asp.net interview questions
C# interview questions
Vb.net interview questions
Ado.net interview questions
Ajax interview questions
Wcf interview questions
Wpf interview questions
.net threading interview questions
.net remoting and webservices interview questions
.net caching interview questions
.net oops interview questions
Sharepoint interview questions
Jquery interview questions
Silverlight interview questions
Linq interview questions
Wwf interview questions
Java interview questions
Sql server interview questions
Ssis interview questions
Ssrs interview questions
Data warehousing interview questions
Data mining interview questions
Oracle interview questions
Php interview questions
Design patterns interview questions
Uml interview questions
Mcpd dumps
Pmp practice tests

This site is best viewed with Internet Explorer 7.0 or higher, Firefox 2.0 or higher, Chrome at a minimum screen resolution of 1024x768.
A complete solution to interview questions
free matrimonial website      
web hosting plans |  compare vps hosting plans |  Compare dedicated hosting plans |  Compare linux hosting plans |  Compare cloud hosting plans |  Compare windows hosting plans | 
Hosting reviews |  GoDaddy reviews | 
Support Wikipedia