PrepAway - Latest Free Exam Questions & Answers

Which code segment should you add at line 05?

You are creating a Windows Forms application. The application loads a data table named dt from a database and modifies each value in the data table. You add the following code.
(Line numbers are included for reference only.)

01 Dim row As DataRow
02 For Each row In dt.Rows
03 Dim col As DataColumn
04 For Each col In dt.Columns
06 Trace.WriteLine(str)
07 Next col
08 Next row

You need to format the string named str to show the value of the column at the time the data is loaded
and the current value in the column. Which code segment should you add at line 05?

PrepAway - Latest Free Exam Questions & Answers

A.
Dim str As String = String.Format(“Column was {0} is now {1}”, row(col), row(col, DataRowVersion.Current))

B.
Dim str As String = String.Format(“Column was {0} is now {1}”, row(col, DataRowVersion.Default), row(col))

C.
Dim str As String = String.Format(“Column was {0} is now {1}”, row(col), row(col, DataRowVersion.Proposed))

D.
Dim str As String = String.Format(“Column was {0} is now {1}”, row(col, DataRowVersion.Original), row(col))


Leave a Reply