System.Data
[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]
1.0.3300.0
1.0.5000.0
2.0.0.0
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
System.ComponentModel.Component
System.Data.IDataAdapter
The serves as a bridge between a and a data source for retrieving and saving data. The provides this bridge by mapping , which changes the data in the to match the data in the data source, and , which changes the data in the data source to match the data in the .
If you are connecting to a SQL Server database, you can increase overall performance by using the along with its associated and objects. For OLE DB-supported data sources, use the with its associated and objects. For ODBC-supported data sources, use the with its associated and objects. For Oracle databases, use the with its associated and objects.
When an instance of is created, the read/write properties are set to initial values. For a list of these values, see the constructor.
Represents a set of SQL commands and a database connection that are used to fill the and update the data source.
Constructor
When an instance of is created, the following read/write properties are set to the following initial values.
-
Properties
Initial value
-
MissingMappingAction.Passthrough
-
MissingSchemaAction.Add
-
An array of objects.
You can change the value of any of these properties through a separate call to the property.
Initializes a new instance of a class.
1.0.5000.0
2.0.0.0
Constructor
1.0.5000.0
2.0.0.0
To be added.
This overload of the constructor is designed for use by a .NET Framework data provider when implementing a similar constructor for use in a clone implementation.
Initializes a new instance of a class from an existing object of the same type.
Property
System.Boolean
To be added: an object of type 'bool'
If false, is not called, and the newly added rows are treated as inserted rows.
Gets or sets a value indicating whether is called on a after it is added to the during any of the Fill operations.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(true)
Property
2.0.0.0
System.ComponentModel.DefaultValue(true)
System.Boolean
To be added.
During a call to the Update method of a DataAdapter, the database can send data back to your ADO.NET application as output parameters or as the first returned record of a result set. ADO.NET can retrieve these values and update the corresponding columns in the being updated. By default, ADO.NET calls the AcceptChanges method of the DataRow after the update. However, if you want to merge the updated row back into another , you may want to preserver the original value of a primary key column. For example, a primary key column corresponding to an automatically incrementing column in the database, such as an identity column, can contain new values that are assigned by the database that do not match the original values assigned in the DataRow. By default, AcceptChanges is called implicitly after an update, and the original values in the row, which may have been values assigned by ADO.NET, are lost. You can preserve the original values in the DataRow by preventing ADO.NET from calling AcceptChanges after it performs an update on a row, by setting the property to false, which preserves the original values.
Setting the AcceptChangesDuringUpdate property to false applies to all data modifications, not only inserts. If you want to edit or delete rows in the same update, and if you want to suppress the call to AcceptChanges only for inserts, then instead of setting AccceptChangesDuringUpdate to false, use an event handler for the RowUpdated event of the DataAdapter. In the event handler you can check the to determine if the data modification is an insert, and if true, set the property of the to . For more information and an example, see Retrieving Identity or Autonumber Values.
Gets or sets whether is called during a .
Method
System.Data.Common.DataAdapter
This method is deprecated. The constructor should be used instead of this method.
All the commands, the , the , and the are cloned. However, the connections for the commands are not copied, but shared. Thus, the cloned can be used against the same connection as the original.
Creates a copy of this instance of .
The cloned instance of .
1.0.5000.0
2.0.0.0
System.Obsolete("Use the protected constructor instead", false)
Property
System.Boolean
To be added: an object of type 'bool'
If ContinueUpdateOnError is set to true, no exception is thrown when an error occurs during the update of a row. The update of the row is skipped and the error information is placed in the property of the row in error. The continues to update subsequent rows.
If ContinueUpdateOnError is set to false, an exception is thrown when an error occurs during the update of a row.
Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(false)
Method
System.Data.Common.DataTableMappingCollection
To be added
Creates a new .
A new table mapping collection.
1.0.5000.0
2.0.0.0
Method
System.Void
This method is called by the public method and the method. Dispose invokes the protected Dispose(Boolean) method with the parameter set to true. invokes Dispose with set to false.
When the parameter is true, this method releases all resources held by any managed objects that this references. This method invokes the Dispose method of each referenced object.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
1.0.5000.0
2.0.0.0
Method
System.Int32
The method retrieves rows from the data source using the SELECT statement specified by an associated property. The connection object associated with the SELECT statement must be valid, but it does not need to be open. If the connection is closed before is called, it is opened to retrieve data, then closed. If the connection is open before is called, it remains open.
The operation then adds the rows to destination objects in the , creating the objects if they do not already exist. When creating objects, the operation normally creates only column name metadata. However, if the property is set to AddWithKey, appropriate primary keys and constraints are also created.
If the SelectCommand returns the results of an OUTER JOIN, the DataAdapter does not set a value for the resulting . You must explicitly define the primary key to ensure that duplicate rows are resolved correctly. For more information, see Defining a Primary Key for a Table.
If the data adapter encounters duplicate columns while populating a , it generates names for the subsequent columns, using the pattern "columnname1", "columnname2", "columnname3", and so on. If the incoming data contains unnamed columns, they are placed in the according to the pattern "Column1", "Column2", and so on. When multiple result sets are added to the each result set is placed in a separate table. Additional result sets are named by appending integral values to the specified table name (for example, "Table", "Table1", "Table2", and so on). Applications using column and table names should ensure that conflicts with these naming patterns does not occur.
When the SELECT statement used to populate the returns multiple results, such as a batch SQL statements, if one of the results contains an error, all subsequent results are skipped and not added to the .
You can use the method multiple times on the same . If a primary key exists, incoming rows are merged with matching rows that already exist. If no primary key exists, incoming rows are appended to the .
When handling batch SQL statements that return multiple results, the implementation of for the .NET Framework Data Provider for OLE DB retrieves schema information for only the first result. To retrieve schema information for multiple results, use with the set to AddWithKey.
Adds or refreshes rows in the to match those in the data source.
The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows.
A to fill with records and, if necessary, schema.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Int32
See the remarks for System.Data.Common.DataAdapter.Fill(System.Data.DataSet) for additional information.
Adds or refreshes rows in the to match those in the data source using the name and the specified .
The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows.
A to fill with records.
An instance of .
Method
2.0.0.0
System.Int32
See the remarks for System.Data.Common.DataAdapter.Fill(System.Data.DataSet) for additional information.
Adds or refreshes rows in a specified range in the collection of objects to match those in the data source.
The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows.
A collection of objects to fill with records.
An instance of .
The zero-based index of the starting record.
An integer indicating the maximum number of records.
Method
2.0.0.0
System.Int32
See the remarks for System.Data.Common.DataAdapter.Fill(System.Data.DataSet) for additional information.
Adds or refreshes rows in a specified range in the to match those in the data source using the and names.
The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows.
A to fill with records.
A string indicating the name of the source table.
An instance of .
The zero-based index of the starting record.
An integer indicating the maximum number of records.
Event
2.0.0.0
System.Data.FillErrorEventHandler
The FillError event allows a user to determine whether or not the fill operation should continue after the error occurs. Examples of when the FillError event might occur are:
-
The data being added to a DataSet cannot be converted to a common language runtime type without losing precision.
-
The row being added contains data that violates a Constraint that must be enforced on a DataColumn in the DataSet.
Returned when an error occurs during a fill operation.
Property
2.0.0.0
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
System.Data.LoadOption
To be added.
To be added.
Gets or sets the that determines how the adapter fills the from the .
Method
System.Data.DataTable[]
The method retrieves the schema from the data source using the . The connection object associated with the must be valid, but it does not need to be open. If the connection is closed before is called, it is opened to retrieve data and then closed. If the connection is open before is called, it remains open.
A operation adds a to the destination . It then adds columns to the of the , and configures the following properties if they exist at the data source:
-
-
. You must set and separately.
-
-
-
also configures the and properties according to the following rules:
-
If one or more primary key columns are returned by the , they are used as the primary key columns for the .
-
If no primary key columns are returned but unique columns are, the unique columns are used as the primary key if, and only if, all the unique columns are nonnullable. If any of the columns are nullable, a is added to the , but the property is not set.
-
If both primary key columns and unique columns are returned, the primary key columns are used as the primary key columns for the .
The underlying data store may allow column attributes that are not supported in a , which causes some column attributes to not translate correctly. For example, ssNoVersion allows an identity column with a data type of tinyint whereas a only allows Int16, Int32, and Int64 to have the property set. FillSchema silently ignores cases where the cannot accurately mirror the data source and throws no exception.
Note that primary keys and unique constraints are added to the according to the preceding rules, but other constraint types are not added.
If a unique clustered index is defined on a column or columns in a SQL Server table and the primary key constraint is defined on a separate set of columns, then the names of the columns in the clustered index will be returned. To return the name or names of the primary key columns, use a query hint with the SELECT statement that specifies the name of the primary key index. For more information about specifying query hints, see Query Hint (Transact-SQL).
If the encounters duplicate columns while populating a , it generates names for the subsequent columns, using the pattern "columnname1", "columnname2", "columnname3", and so on. If the incoming data contains unnamed columns, they are placed in the according to the pattern "Column1", "Column2", and so on. When multiple result sets are added to the each result set is placed in a separate table. Additional result sets are named by appending integral values to the specified table name (for example, "Table", "Table1", "Table2", and so on). Applications using column and table names should ensure that conflicts with these naming patterns does not occur.
does not return any rows. Use the method to add rows to a .
When handling batch SQL statements that return multiple results, the implementation of for the .NET Framework Data Provider for OLE DB retrieves schema information for only the first result. To retrieve schema information for multiple results, use with the set to AddWithKey.
Adds a to the specified and configures the schema to match that in the data source based on the specified .
A object that contains schema information returned from the data source.
The to be filled with the schema from the data source.
One of the values.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Data.DataTable
To be added.
Adds a to the specified .
A object that contains schema information returned from the data source.
The to be filled from the .
One of the values.
The to be used as the data source when filling the .
Method
2.0.0.0
System.Data.DataTable[]
To be added.
Adds a to the specified .
A reference to a collection of objects that were added to the .
The to be filled from the .
One of the values.
The name of the source table to use for table mapping.
The to be used as the data source when filling the .
Method
System.Data.IDataParameter[]
To be added
Gets the parameters set by the user when executing an SQL SELECT statement.
An array of objects that contains the parameters set by the user.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
Method
2.0.0.0
System.Boolean
To be added.
Indicates whether a has been created.
true if a has been created; otherwise false.
Property
System.Data.MissingMappingAction
To be added: an object of type 'Data.MissingMappingAction'
The property provides the master mapping between the returned records and the .
Determines the action to take when incoming data does not have a matching table or column.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Data.MissingMappingAction.Passthrough)
Property
System.Data.MissingSchemaAction
To be added: an object of type 'Data.MissingSchemaAction'
To be added
Determines the action to take when existing schema does not match incoming data.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Data.MissingSchemaAction.Add)
Method
2.0.0.0
System.Void
To be added.
Invoked when an error occurs during a Fill.
A object.
Method
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.Void
To be added.
Resets to its default state and causes to honor .
Property
2.0.0.0
System.ComponentModel.DefaultValue(false)
System.Boolean
To be added.
The default value is false.
Gets or sets whether the Fill method should return provider-specific values or common CLS-compliant values.
Method
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.Boolean
To be added.
Determines whether the property should be persisted.
true if the property is persisted; otherwise false.
Method
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.Boolean
To be added.
Determines whether the property should be persisted.
true if the property is persisted; otherwise false.
Method
System.Boolean
To be added
Determines whether one or more objects exist and they should be persisted.
true if one or more objects exist; otherwise false.
1.0.5000.0
2.0.0.0
Property
1.0.5000.0
2.0.0.0
System.Data.ITableMappingCollection
To be added.
This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
Fore more information, see .
Indicates how a source table is mapped to a dataset table.
Property
System.Data.Common.DataTableMappingCollection
To be added: an object of type 'DataTableMappingCollection'
When reconciling changes, the uses the collection to associate the column names used by the data source with the column names used by the .
Gets a collection that provides the master mapping between a source table and a .
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)
Method
System.Int32
The update is performed on a by-row basis. For every inserted, modified, and deleted row, the method determines the type of change that has been performed on it (Insert, Update or Delete). Depending on the type of change, the Insert, Update, or Delete command template executes to propagate the modified row to the data source. When an application calls the method, the examines the property, and executes the required INSERT, UPDATE, or DELETE statements iteratively for each row, based on the order of the indexes configured in the . For example, might execute a DELETE statement, followed by an INSERT statement, and then another DELETE statement, due to the ordering of the rows in the .
It should be noted that these statements are not performed as a batch process; each row is updated individually. An application can call the method in situations where you must control the sequence of statement types (for example, INSERT before UPDATE). For more information, see Updating the Database with a DataAdapter and the DataSet.
If INSERT, UPDATE, or DELETE statements have not been specified, the method generates an exception. However, you can create a or object to automatically generate SQL statements for single-table updates if you set the SelectCommand property of a .NET Framework data provider. Then, any additional SQL statements that you do not set are generated by the CommandBuilder. This generation logic requires key column information to be present in the . For more information see Automatically Generated Commands.
The method retrieves rows from the table listed in the first mapping before performing an update. The then refreshes the row using the value of the property. Any additional rows returned are ignored.
After any data is loaded back into the , the event is raised, allowing the user to inspect the reconciled row and any output parameters returned by the command. After a row updates successfully, the changes to that row are accepted.
When using , the order of execution is as follows:
-
The values in the are moved to the parameter values.
-
The event is raised.
-
The command executes.
-
If the command is set to FirstReturnedRecord, then the first returned result is placed in the .
-
If there are output parameters, they are placed in the .
-
The event is raised.
-
is called. This will raise both the and events for the updated .
Each command associated with the usually has a parameters collection associated with it. Parameters are mapped to the current row through the SourceColumn and SourceVersion properties of a.NET data provider's Parameter class. SourceColumn refers to a column that the references to obtain parameter values for the current row.
SourceColumn refers to the unmapped column name before any table mappings have been applied. If SourceColumn refers to a nonexistent column, the action taken depends on one of the following values.
-
Enumeration value
Action taken
-
MissingMappingAction.Passthrough
Use the source column names and table names in the if no mapping is present.
-
MissingMappingAction.Ignore
A is generated. When the mappings are explicitly set, a missing mapping for an input parameter is usually the result of an error.
-
MissingMappingAction.Error
A is generated.
The SourceColumn property is also used to map the value for output or input/output parameters back to the DataSet. An exception is generated if it refers to a nonexistent column.
The SourceVersion property of a .NET data provider's Parameter class determines whether to use the Original, Current, or Proposed version of the column value. This capability is often used to include original values in the WHERE clause of an UPDATE statement to check for optimistic concurrency violations.
Calling the method or method will commit all changes in the or . If either of these methods are called before the method is called, no changes will be committed when the method is called, unless further changes have been made since or was called.
If an error occurs while updating a row, an exception is thrown and execution of the update is discontinued. To continue the update operation without generating exceptions when an error is encountered, set the property to true before calling . You may also respond to errors on a per-row basis within the RowUpdated event of a DataAdapter. To continue the update operation without generating an exception within the RowUpdated event, set the property of the to .
For every column that you propagate to the data source on , a parameter should be added to the InsertCommand, UpdateCommand, or DeleteCommand. The SourceColumn property of the parameter should be set to the name of the column. This setting indicates that the value of the parameter is not set manually, but is taken from the particular column in the currently processed row.
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified from a named "Table."
The number of rows successfully updated from the .
The used to update the data source.
1.0.5000.0
2.0.0.0