Manually Configuring Your SqlDataAdapter Objects

The SqlDataAdapter class exposes four properties that contain Command objects. You’ve already learned that the SelectCommand property contains the Command that the SqlDataAdapter uses to fill your DataTable. The other three properties—UpdateCommand, InsertCommand, and DeleteCommand—contain the Command objects that the SqlDataAdapter uses to submit pending changes.

This architecture represents a major change from previous Microsoft data-access technologies, such as ADO. There is no magical "black box" technology involved. You control the logic the SqlDataAdapter uses to submit pending changes because you supply the SqlCommand objects that the SqlDataAdapter uses.

The SqlDataAdapter class’s Update

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.