Automatically generates single-table commands used to reconcile changes made to a System.Data.DataSet with the associated database.
Public Class ULCommandBuilder Inherits System.Data.Common.DbCommandBuilder
public class ULCommandBuilder : System.Data.Common.DbCommandBuilder
All members of ULCommandBuilder class, including all inherited members.
Name | Description |
---|---|
Initializes a ULCommandBuilder object. | |
|
Allows the provider implementation of the ![]() |
|
Releases the unmanaged resources used by the ![]() |
Gets the automatically generated ULCommand object required to perform deletions on the database. | |
Gets the automatically generated ULCommand object required to perform insertions on the database. | |
|
Returns the name of the specified parameter in the format of @p#. |
|
Returns the placeholder for the parameter in the associated SQL statement. |
|
Returns the schema table for the ![]() |
Gets the automatically generated ULCommand object required to perform updates on the database. | |
|
Resets the ![]() ![]() ![]() ![]() ![]() |
|
Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier, including properly escaping any embedded quotes in the identifier. |
|
Clears the commands associated with this ![]() |
|
Adds an event handler for the ![]() |
|
Registers the ![]() ![]() ![]() |
|
Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier. |
|
Sets or gets the ![]() ![]() |
|
Sets or gets a string used as the catalog separator for an instance of the ![]() |
|
Specifies which ![]() ![]() |
Gets or sets a ULDataAdapter object for which SQL statements are automatically generated. | |
|
Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. |
|
Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. |
|
Gets or sets the character to be used for the separator between the schema identifier and any other identifiers. |
|
Specifies whether all column values in an update statement are included or only changed ones. |
The ULDataAdapter object does not automatically generate the SQL statements required to reconcile changes made to a System.Data.DataSet with the associated data source. However, you can create a ULCommandBuilder object to automatically generate SQL statements for single-table updates if you set the SelectCommand property of the ULDataAdapter object. Then, any additional SQL statements that you do not set are generated by the ULCommandBuilder object.
The following example uses the ULCommand object, along with the ULDataAdapter and ULConnection objects, to select rows from a data source. The example is passed a connection string, a query string that is a SQL SELECT statement, and a string that is the name of the database table. The example then creates a ULCommandBuilder object.
' Visual Basic Public Shared Function SelectULRows(ByVal connectionString As String, _ ByVal queryString As String, ByVal tableName As String) Dim connection As ULConnection = New ULConnection(connectionString) Dim adapter As ULDataAdapter = New ULDataAdapter() adapter.SelectCommand = New ULCommand(queryString, connection) Dim builder As ULCommandBuilder = New ULCommandBuilder(adapter) connection.Open() Dim dataSet As DataSet = New DataSet() adapter.Fill(dataSet, tableName) 'Insert code to modify data in DataSet. 'Without the ULCommandBuilder this line would fail adapter.Update(dataSet, tableName) Return dataSet End Function |
The following code is the C# language equivalent:
// C# public static DataSet SelectULRows(string connectionString, string queryString, string tableName) { using (ULConnection connection = new ULConnection(connectionString)) { ULDataAdapter adapter = new ULDataAdapter(); adapter.SelectCommand = new ULCommand(queryString, connection); ULCommandBuilder builder = new ULCommandBuilder(adapter); connection.Open(); DataSet dataSet = new DataSet(); adapter.Fill(dataSet, tableName); // Insert code to modify data in DataSet. // Without the ULCommandBuilder this line would fail adapter.Update(dataSet, tableName); return dataSet; } } |
ULCommandBuilder constructor
GetDeleteCommand method
GetInsertCommand method
GetUpdateCommand method
DataAdapter property
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |