Hi there,
Although it may not be obvious at first, both methods actually do the same thing.
When you drag the database table on the page (step 7 on page 458), Visual Studio creates a SqlDataSource that supports deleting. For the manually created data source, you need to do this explicitly. The result is the same: the SqlDataSource has its DeleteCommand set up.
Deleting in the GridView is configured differently as well, but the final result is the same. When you enable it in the Smart Tasks panel, VS adds the following code to the GridView:
Code:
<asp:CommandField ShowDeleteButton="True" />
For the second GridView, in step 5 on page 475, you create a CommandField with its ShowDeleteButton set to true, resulting in the exact same code.
Hope this helps,
Imar