Muhammad Imran Ansari
What is difference between CommandBuilder and DataAdapter class?

What is difference between CommandBuilder and DataAdapter class?

By Muhammad Imran Ansari in .NET on Apr 03 2022
  • Jayraj Chhaya
    Sep, 2022 10

    1. The **SqlCommandBuilder** opens the Connection associated with the DataAdapter and makes a round trip to the server each and every time it's asked to construct the action queries. It closes the Connection when it's done. The following C# Source Code demonstrate how to use the SqlDataAdapter object to update a SQL Server database with data modifications that are run on a DataSet Object that is populated with data from a table in the database using SqlCommandBuilder object.
    2. The **DataAdapter** is a part of the ADO.NET Data Provider. ADO.NET DataAdapter is used to manage four separate Command objects. The InsertCommand , the UpdateCommand , and the DeleteCommand properties of the SqlDataAdapter object update the database with the data modifications that are run on a DataSet object. The SqlCommand objects that are assigned to these properties can be created manually in code or automatically generated by using the SqlCommandBuilder object.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS