UPGRADE-MCAD-Skills-to-MCPD-Wdws-Dvlpr-by-Using-MS-NET-Frmwk-Csharp-(70-552-CSharp).pdf

This preview shows page 1 - 4 out of 7 pages.

70-552-CSharpMicrosoftUPGRADE-MCAD Skills to MCPD Wdws Dvlpr by Using MS.NETFrmwk
Answer:AQUESTION:78AWindowsFormsapplicationcontainsthefollowingcodesegment.string SQL = @"SELECT EmployeeID, LastName, FirstName FROM Employees";SqlDataAdapter da = new SqlDataAdapter(SQL, connStr);DataTable dt = new DataTable();da.MissingSchemaAction = MissingSchemaAction.AddWithKey;SqlCommandBuilder bld = new SqlCommandBuilder(da); da.Fill(dt);The application allows the user to add rows to the data table. The application will propagatethese additions to the database. If the addition of any row fails, the other rows must still beadded. The code must log how many new rows failed to be added. You need to propagatethe additions to the database and log a failed count. Which code segment should you use?
QUESTION:79AWindowsFormsapplicationcontainsthefollowingcodesegment.string SQL = @"SELECT OrderID, ProductID, UnitPrice, Quantity FROM[Order Details]";SqlDataAdapter da = new SqlDataAdapter(SQL, connStr);DataTable dt = new DataTable();da.Fill(dt);You need to add a new column to the data table named ItemSubtotal. The ItemSubtotalcolumn must contain the value of the UnitPrice column multiplied by the value of theQuantity column. Which code segment should you use?
43
B. dt.Compute("UnitPrice * Quantity", "ItemSubtotal");C. DataColumn col = new DataColumn("ItemSubtotal");col.DataType =typeof(decimal);dt.Columns.Add(col);dt.Compute("UnitPrice * Quantity", "ItemSubtotal");D. DataColumn col = new DataColumn("ItemSubtotal");col.DataType =typeof(decimal);col.DefaultValue="UnitPrice*Quantity";dt.Columns.Add(col);Answer:A

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 7 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
Mohammad Alizadeh
Tags
Microsoft SQL Server, Stored procedure

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture