googlebot
Buy Differin Gel Online
ADVERTISEMENT

Learn About the Visual Basic Version of Microsoft’s Exam 70-568

  By Certification Magazine —

1 | 2 | 3 |

You should not call the FindControl method of the Page class to retrieve the HTML Input element. The FindControl method finds server controls only. In this scenario, the HTML Input element is not a server control because it is missing the runat=server attribute.

References:
HttpRequest.Form Property
MSDN
http://msdn.microsoft.com/en-us/library/system.web.httprequest.form.aspx

HttpRequest.Params Property
MSDN
http://msdn.microsoft.com/en-us/library/system.web.httprequest.params.aspx

ASP.NET Intrinsic Objects
MSDN
http://msdn.microsoft.com/en-us/library/x6w6xys5(VS.71).aspx

Objective: Working with Data and Services.
SubObjective: Manipulate data by using DataSet and DataReader objects.

Single answer, multiple choice

You create a Web application by using Microsoft ASP.NET 3.5. You create a DataSet instance named dataSet from the following XML data:

<Vehicles>
 <Car Vin="1HGCDXXX4">
 <Car Vin="1TTGCDXXX3">
 <Truck Vin="1SVCDXXX2">
 <Suv Vin="1SVCDXXX0">
 <Minivan Vin="1TTGCDXXX1">
 <Minivan Vin="1HGCDXXX5">
</Vehicles> 


In this XML, the Vin attribute represents a vehicle identification number (VIN) for a vehicle. A method named ProcessVin accepts a VIN as a parameter.

You need to create a DataTableReader instance and call the ProcessVin method for each vehicle.

Which code segment should you use?

A.    Using reader As dataSet.CreateDataReader()
    Do
        While reader.Read()
            ProcessVin(reader("Vin"))
        End While
    Loop While reader.NextResult()
End Using

B.    Using reader As dataSet.CreateDataReader()
    While reader.NextResult()
        reader.Read()
        ProcessVin(reader.GetString(0))
    End While
End Using

C.    Using reader As dataSet.CreateDataReader()
    Do
        ProcessVin(reader("Vin"))
    Loop While (reader.NextResult())
End Using

D.    Using reader As dataSet.CreateDataReader()
    Do
        While reader.NextResult()
            ProcessVin(reader.GetString(0))
        End While
    Loop While (reader.Read())
End Using

Answer:
A

Tutorial:
You should use a Do...While loop to navigate each result set in the DataSet instance. To navigate each result set, you must first create a DataTableReader instance by calling the CreateDataReader method of the DataSet class. This creates a reader that can be used to navigate the rows of each DataTable instance in the DataSet instance. When you first call the method, the reader is positioned on the first DataTable instance. By calling the Read method, you position the reader on the first row. You should then call the ProcessVin method for that row. To access the Vin field of that row, you can call the GetString method and pass the value 0 as a parameter, or you can pass the value Vin to the property indexer. If you call the GetString method, the value 0 specifies the first field in the row. You should call the Read method for each row. You can accomplish this by placing the call to the Read method in a While loop. If the Read method returns False, then there are no more rows to read in the current result set.

You should not call the NextResult method of the DataTableReader instance inside a While loop before processing the rows of the first result set. When you create the DataTableReader instance, it is positioned on the first result set. If you call the NextResult method immediately after creating the instance, you position the reader on the second result set.

You should not attempt to access the fields of a row before you call the Read method of the DataTableReader class. The Read method advances the reader to the next row of a result set. When you create the DataTableReader instance, it is positioned on the first result set, but it is not positioned on the first row. You must call the Read method to advance the reader to the first row.

You should not call the Read method of the DataTableReader instance inside a Do...While loop and attempt to access the rows inside the loop. You must call the Read method before accessing the rows. Also, you should call the NextResult method only after the Read method returns False, which indicates there are no more rows in the current result set.

References:
DataTableReader (ADO.NET)
MSDN
http://msdn.microsoft.com/en-us/library/ws7ad65f.aspx

Navigating DataTables (ADO.NET)
MSDN
http://msdn.microsoft.com/en-us/library/z071789y.aspx

Creating a DataReader (ADO.NET)
MSDN
http://msdn.microsoft.com/en-us/library/3fhe1t3x.aspx


Objective: Working with ASP.NET AJAX and Client-Side Scripting.
SubObjective: Implement Web Forms by using ASP.NET AJAX.

Single answer, multiple choice

You create a Web application by using Microsoft ASP.NET 3.5. The following markup exists on a page:

<asp:ScriptManager ID="_scriptManager" runat="server"/>
<asp:UpdatePanel ID="_updatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="_gridView" runat="server"/>
<asp:Button ID="_submitButton" runat="server" Text="Submit"/>
<asp:Button ID="_refreshButton" runat="server" Text="Refresh"/>
</ContentTemplate>
</asp:UpdatePanel>


You need to write code so the _refreshButton control causes the entire page to be posted back.

Which code segment should you use?

A.    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
 _scriptManager.RegisterAsyncPostBackControl(_refreshButton)
End Sub

B.    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
 Page.RegisterRequiresPostBack(_refreshButton)
End Sub

C.    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
 _scriptManager.RegisterPostBackControl(_refreshButton)
End Sub

D.    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
 Page.RegisterRequiresRaiseEvent(_refreshButton)
End Sub

Answer:
C

Tutorial:
You should call the RegisterPostBackControl method of the ScriptManager class. This method instructs a control to always cause a full post back instead of an asynchronous post back. By default, controls that are children of an UpdatePanel control perform asynchronous post backs if the ChildrenAsTriggers property of the UpdatePanel control is set to True, which is the default value. To prevent a child control from performing an asynchronous post back, you must either set ChildrenAsTriggers to False or call the RegisterPostBackControl method for the child control.

1 | 2 | 3 |
Viewed 9787 times.
SPONSORED LINKS
gps systems used