You need to update the GetBook() method to retrieve book data by using ADO.NET.
You have the following code:
Which code segments should you include in Target 1, Target 2, Target 3, Target 4 and Target 5 to complete the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Select and Place:
It should be:
Target 1: 1st option
Target 2: 3rd option
Target 3: 5th option
Target 4: 7th option
Target 5: 9th option
Answer is wrong
The answer is wrong.
It should be:
Target 1: 1st option
Target 2: 3rd option
Target 3: 5th option
Target 4: 7th option
Target 5: 9th option
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-code-examples
https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqldatareader.getordinal?view=netframework-4.7.2
Target 2 should have the 3rd option the one with the @id.
Refer https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-code-examples
Target 4 should be the 7th option the one with string “id”
https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqldatareader.getordinal?view=netframework-4.7.2
Target 5 should be the 9th option the one with the string “name”.
https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqldatareader.getordinal?view=netframework-4.7.2
IMHO the answer is:
Target 1: 1st option.
Target 2: 3rd option
Target 3: 5th option
Target 4: 7th option
Target 5: 9th option