You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
The application has a DataTable object named OrderDetailTable. The object has the following columns:
ID
OrderID
ProductID
Quantity
LineTotal
The OrderDetailTable object is populated with data provided by a business partner. Some of the records contain a null value in the LineTotal field and 0 in the Quantity field.
You write the following code segment. (Line numbers are included for reference only.)
01 DataColumn col = new DataColumn("UnitPrice", typeof(decimal));
02
03 OrderDetailTable.Columns.Add(col);
You need to add a DataColumn named UnitPrice to the OrderDetailTable object.
Which line of code should you insert at line 02?
A.
col.Expression = "LineTotal/Quantity";
B.
col.Expression = "LineTotal/ISNULL(Quantity, 1)";
C.
col.Expression = "LineTotal.Value/ISNULL(Quantity.Value,1)";
D.
col.Expression = "iif(Quantity > 0, LineTotal/Quantity, 0)";