Initializes a new instance of the ADODataSetCommand class with the specified select command.
[Visual Basic] Overloads Public Sub New( _ ByVal selectCommand As ADOCommand _ ) [C#] public ADODataSetCommand( ADOCommand selectCommand ); [C++] public: ADODataSetCommand( ADOCommand* selectCommand ); [JScript] public function ADODataSetCommand( selectCommand : ADOCommand );
When you create an instance of ADODataSetCommand, the following read/write properties are set to initial values.
Properties | Initial Value |
---|---|
SelectCommand | A new ADOCommand that is a copy of selectCommand. |
InsertCommand | A new ADOCommand. |
DeleteCommand | A new ADOCommand. |
UpdateCommand | A new ADOCommand. |
MissingMappingAction | MissingMappingAction.Passthrough |
MissingSchemaAction | MissingSchemaAction.Add |
You can change the value of any of these properties through a separate call to the property.
The following example shows how to create the ADODataSetCommand with an ADOCommand that is a select command as a parameter.
[Visual Basic]
Sub CreateDataSetCommand () Dim adoDataSetComm As ADODataSetCommand Dim myConnection As String Dim mySelectComm As String Dim myADOSelect As ADOCommand ' Set myConnection to the connection string text myConnection = "Provider=SQLADO.1;User ID=sa;PASSWORD=;" _ + "Initial Catalog=Northwind;Data Source=vbsql7;" ' Set mySelectComm to the text of the select command mySelectComm = "SELECT intID, vchFirstName, vchLastName " _ + "FROM Customers" ' Initialize myADOSelect command as a new object myADOSelect = New ADOCommand mySelectComm myConnection ' Initialize adoDataSetComm as a new object adoDataSetComm = New ADODataSetCommand myADOSelect End Sub
ADODataSetCommand Class | ADODataSetCommand Members | System.Data.ADO Namespace | ADODataSetCommand Constructor Overload List | MissingMappingAction | MissingSchemaAction