Export (0) Print
Expand All

SqlCeDataAdapter Constructor (String, SqlCeConnection)

Initializes a new instance of the SqlCeDataAdapter class with a SelectCommand and a SqlCeConnection object.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

public SqlCeDataAdapter(
	string selectCommandText,
	SqlCeConnection selectConnection
)

Parameters

selectCommandText
Type: System.String
A String that is an SQL SELECT statement to be used as the CommandText of the SelectCommand property of the SqlCeDataAdapter.
selectConnection
Type: System.Data.SqlServerCe.SqlCeConnection
A SqlCeConnection that represents the connection.

This implementation of the SqlCeDataAdapter opens and closes a SqlCeConnection if it is not already open. This can be useful in an application that must call the Fill method for two or more SqlCeDataAdapter objects. If the SqlCeConnection is already open, you must explicitly call Close or Dispose to close it.

When you create an instance of SqlCeDataAdapter, the following read/write properties are set to the following initial values.

Properties

Initial Value

MissingMappingAction

MissingMappingAction.Passthrough

MissingSchemaAction

MissingSchemaAction.Add

You can change the value of any of these properties by making a separate call to that property.

The following example creates a SqlCeDataAdapter by passing the command string and a SqlCeConnection object.

Show:
© 2014 Microsoft