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. | |
ApplyParameterInfo method (Inherited from System.Data.Common.DbCommandBuilder) |
Allows the provider implementation of the System.Data.Common.DbCommandBuilder class to handle additional parameter properties. |
Dispose method (Inherited from System.Data.Common.DbCommandBuilder) |
Releases the unmanaged resources used by the System.Data.Common.DbCommandBuilder and optionally releases the managed resources. |
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. | |
GetParameterName method (Inherited from System.Data.Common.DbCommandBuilder) |
Returns the name of the specified parameter in the format of @p#. |
GetParameterPlaceholder method (Inherited from System.Data.Common.DbCommandBuilder) |
Returns the placeholder for the parameter in the associated SQL statement. |
GetSchemaTable method (Inherited from System.Data.Common.DbCommandBuilder) |
Returns the schema table for the System.Data.Common.DbCommandBuilder. |
Gets the automatically generated ULCommand object required to perform updates on the database. | |
InitializeCommand method (Inherited from System.Data.Common.DbCommandBuilder) |
Resets the System.Data.Common.DbCommand.CommandTimeout, System.Data.Common.DbCommand.Transaction, System.Data.Common.DbCommand.CommandType, and System.Data.UpdateRowSource properties on the System.Data.Common.DbCommand. |
QuoteIdentifier method (Inherited from System.Data.Common.DbCommandBuilder) |
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. |
RefreshSchema method (Inherited from System.Data.Common.DbCommandBuilder) |
Clears the commands associated with this System.Data.Common.DbCommandBuilder. |
RowUpdatingHandler method (Inherited from System.Data.Common.DbCommandBuilder) |
Adds an event handler for the System.Data.OleDb.OleDbDataAdapter.RowUpdating event. |
SetRowUpdatingHandler method (Inherited from System.Data.Common.DbCommandBuilder) |
Registers the System.Data.Common.DbCommandBuilder to handle the System.Data.OleDb.OleDbDataAdapter.RowUpdating event for a System.Data.Common.DbDataAdapter |
UnquoteIdentifier method (Inherited from System.Data.Common.DbCommandBuilder) |
Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier. |
CatalogLocation property (Inherited from System.Data.Common.DbCommandBuilder) |
Sets or gets the System.Data.Common.CatalogLocation for an instance of the System.Data.Common.DbCommandBuilder class. |
CatalogSeparator property (Inherited from System.Data.Common.DbCommandBuilder) |
Sets or gets a string used as the catalog separator for an instance of the System.Data.Common.DbCommandBuilder class. |
ConflictOption property (Inherited from System.Data.Common.DbCommandBuilder) |
Specifies which System.Data.ConflictOption is to be used by the System.Data.Common.DbCommandBuilder. |
Gets or sets a ULDataAdapter object for which SQL statements are automatically generated. | |
QuotePrefix property (Inherited from System.Data.Common.DbCommandBuilder) |
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. |
QuoteSuffix property (Inherited from System.Data.Common.DbCommandBuilder) |
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. |
SchemaSeparator property (Inherited from System.Data.Common.DbCommandBuilder) |
Gets or sets the character to be used for the separator between the schema identifier and any other identifiers. |
SetAllValues property (Inherited from System.Data.Common.DbCommandBuilder) |
Specifies whether all column values in an update statement are included or only changed ones. |
The ULDataAdapter 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. Then, any additional SQL statements that you do not set are generated by the ULCommandBuilder.
The following example uses the ULCommand, along with ULDataAdapter and ULConnection, 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.
' 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 © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |