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.

The interface allows an inheriting class to implement a DataAdapter class, which represents the bridge between a data source and a . For more information about DataAdapter classes, see [<topic://cpconpopulatingdatasetfromdataadapter>].

An application does not create an instance of the interface directly, but implements an instance of a class that inherits .

Classes that inherit must implement the inherited members, and they typically define additional members to add provider-specific functionality. For example, the interface defines a method that takes a as a parameter. In turn, the class inherits the method and also defines two additional overloads of the method that take an ADO Recordset object as a parameter.

Allows an object to implement a DataAdapter, and represents a set of methods and mapping action-related properties that are used to fill and update a and update a data source.

instances are for data sources that are (or resemble) relational databases with textual commands (like tsql), while instances could can use any type of data source.

- Method
  System.Int32 ``

  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 usually 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 [<topic://cpcondefiningprimarykeyfortable>].

  If the encounters duplicate columns while populating a , it generates names for the successive columns, using the pattern "columnname1", "columnname2", "columnname3", and so on. If the incoming data contains unnamed columns, they are put in the according to the pattern "Column1", "Column2", and so on. When multiple result sets are added to the , each result set is put 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 should use caution when using column and table names to ensure that conflicts with these naming patterns do not occur.

  When the SELECT statement that is used to populate the returns multiple results, such as a batch SQL statement, if one of the results contains an error, all successive 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 and for a .NET Framework data provider retrieves schema information for only the first result.

  Adds or updates rows in the to match those in the data source using the name, and creates a named "Table".

  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
  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, 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 all the unique columns are non-nullable. 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 .

  Note that primary keys and unique constraints are added to the according to the previous 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 how to specify query hints, see Query Hint (Transact-SQL).

  If the encounters duplicate columns while populating a , it generates names for the successive columns, using the pattern "columnname1", "columnname2", "columnname3", and so on. If the incoming data contains unnamed columns, they are put in the according to the pattern "Column1", "Column2", and so on. When multiple result sets are added to the , each result set is put 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 should use caution when using column and table names to ensure that conflicts with these naming patterns do not occur.

  returns no rows. Use the method to add rows to a .

  Adds a named "Table" to the specified and configures the schema to match that in the data source based on the specified .

  An array of objects that contain 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
  System.Data.IDataParameter[] `private static void GetParameters(String connectiongString) { using (SqlConnection conn = new SqlConnection(connectiongString)) { String queryString = "Select [CourseID],[Title],[Credits] from [MySchool].[dbo].[Course] where [Year]=@Year and [Credits]>=@Credits"; SqlParameter year = new SqlParameter("@Year", 2012); SqlParameter credits = new SqlParameter("@Credits", SqlDbType.Int, 4, "Credits"); credits.Value = 4; SqlCommand command = new SqlCommand(queryString, conn); command.Parameters.Add(year); command.Parameters.Add(credits); IDbDataAdapter mySchool = new SqlDataAdapter(command); IDataParameter[] parameters = mySchool.GetFillParameters(); Console.WriteLine("{0,-15}{1,-15}{2,-15}{3,-15}{4,-15}", "ParameterName", "SourceColumn", "Direction", "DbType", "Value"); foreach (IDataParameter parameter in parameters) { Console.WriteLine("{0,-15}{1,-15}{2,-15}{3,-15}{4,-15}", parameter.ParameterName, parameter.SourceColumn, parameter.Direction, parameter.DbType, parameter.Value); } } }`

  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
- Property
  System.Data.MissingMappingAction To be added: an object of type 'MissingMappingAction'

  The property provides the master mapping between the returned records and the .

  Indicates or specifies whether unmapped source tables or columns are passed with their source names in order to be filtered or to raise an error.

  1.0.5000.0
  2.0.0.0
- Property
  System.Data.MissingSchemaAction To be added: an object of type 'MissingSchemaAction' To be added

  Indicates or specifies whether missing source tables, columns, and their relationships are added to the dataset schema, ignored, or cause an error to be raised.

  1.0.5000.0
  2.0.0.0
- Property
  System.Data.ITableMappingCollection To be added: an object of type 'ITableMappingCollection'

  The uses only the mappings for the source table named "Table". All SELECT, INSERT, DELETE, and UPDATE statements returning data must do so using consistent column naming. The column names returned in the records must be unique, otherwise columns with duplicate names overwrite previous data. On , only the table mapped to the source table named "Table" will have its changes reconciled.

  Indicates how a source table is mapped to a dataset table.

  1.0.5000.0
  2.0.0.0
- Method
  System.Int32 ``

  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, because of the ordering of the rows in the .

  Be aware that these statements are not performed as a batch process; each row is updated individually. An application can call the method if you must control the sequence of statement types (for example, INSERTs before UPDATEs). For more information, see [<topic://cpconUpdatingDatabaseWithDataAdapterDataSet>].

  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 [<topic://cpconAutomaticallyGeneratedCommands>].

  The method retrieves rows from the table listed in the first mapping before performing an update. The then updates 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 put in the .

  If there are output parameters, they are put in the .

  The event is raised.

  is called.

  Each command associated with the usually has a parameter collection associated with it. Parameters are mapped to the current row through the SourceColumn and SourceVersion properties of a .NET Framework 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 caused by 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 Framework data provider's Parameter class determines whether to use the Original, Current, or Proposed version of the column value. This capability is frequently used to include original values in the WHERE clause of an UPDATE statement to check for optimistic concurrency violations.

  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 .

  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