You are creating a Windows Forms application for inventory management by using the
.NET Framework 3.5.The application provides a form that allows users to maintain stock
balances. The form has the following features:
A dataset named dsStockBalance to store the stock information
A business component named scInventory
The scInventory component provides a method named Save.You need to ensure that only
the modified stock balances of dsStockBalance are passed to the scInventory.Save
method.Which code segment should you use?
A.
if(dsStockBalance.HasChanges())
dsStockBalance.AcceptChanges();
dsUpdates = dsStockBalance.GetChanges();
scInventory.Save(dsStockBalance);
B.
if(dsStockBalance.HasChanges())
dsUpdates = dsStockBalance.GetChanges();
dsStockBalance.AcceptChanges();
scInventory.Save(dsStockBalance);
C.
if(dsStockBalance.HasChanges())
{
dsStockBalance.AcceptChanges();
dsUpdates = dsStockBalance.GetChanges();
scInventory.Save(dsUpdates);
}
D.
if(dsStockBalance.HasChanges())
{
dsUpdates = dsStockBalance.GetChanges();
dsStockBalance.AcceptChanges();
scInventory.Save(dsUpdates);
}