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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.