ComponentOne ADO.NET DataExtender
C1.C1DataExtender.2 Assembly / C1.C1DataExtender Namespace / C1DataViewSet Class / Update Method

In This Topic
    Update Method (C1DataViewSet)
    In This Topic
    Commit data changes made in contained C1DataView objects and underlying DataTable objects back to database server.
    Syntax
    'Declaration
     
    Public Sub Update() 
    public void Update()
    Remarks
    When performing database update, C1DataViewSet takes in account types of corrections performed on data rows and interrelations between DataTable objects of an underlying DataSet so as to commit data rows in a correct order, preventing possible conflicts on a server.

    For newly added rows which has a server-side autogenerated primary key, C1DataViewSet retrieve (if possible, see below) this value from server and update corresponding row column on a client with this value. If such a row has child rows from another DataTable, C1DataViewSet updates their foreign key values with the new value as well, and only after it commit those child rows to server, which guarantee that child rows are committed with correct foreign key values.

    Because some values of committing row can be changed on a server during update process, C1DataViewSet retrieve values of each committed row back to a client and updates client row values.

    Different database servers provides different ways to retrieve generated autoincrement values. The details of how autoincrement values can be retrieved from server can be defined for a specific server in DataSet Extender, see the C1.C1DataExtender.SchemaExtender.DataTableExtender.ConnectionInfo property description for details. Note that for some types of database servers with which C1DataExtender is familiar this information is detected automatically, so you could not set up it manually. Examples of such servers are Access, MS SQL and Oracle.

    Example
    The following example uses a button control to implement the Update method:
    • Visual Basic Private Sub Button1_Click(sender As Object, e As EventArgs) C1DataViewSet1.Update() End Sub
    • C# private void button1_Click(object sender, EventArgs e) { C1DataViewSet1.Update(); }
    See Also