NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ADODataSetCommand Constructor (String, ADOConnection)

Inintialize a new instance of the ADODataSetCommand class with a select command and a connection.

[Visual Basic]
Overloads Public Sub New( _
   ByVal selectCommandText As String, _
   ByVal selectConnection As ADOConnection _
)
[C#]
public ADODataSetCommand(
   string selectCommandText,
   ADOConnection selectConnection
);
[C++]
public: ADODataSetCommand(
   String* selectCommandText,
   ADOConnection* selectConnection
);
[JScript]
public function ADODataSetCommand(
   selectCommandText : String,
   selectConnection : ADOConnection
);

Parameters

selectCommandText
The select command string.
selectConnection
An ADOConnection that represents the connection.

Remarks

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 has selectConnection as its connection and selectCommandText as its command text.
InsertCommand A new ADOCommand that has selectConnection as its connection.
DeleteCommand A new ADOCommand that has selectConnection as its connection.
UpdateCommand A new ADOCommand that has selectConnection as its connection.
MissingMappingAction MissingMappingAction.Passthrough
MissingSchemaAction MissingSchemaAction.Add

You can change the value of any of these properties through a separate call to the property.

Example [Visual Basic]

The following example shows how to create the ADODataSetCommand with a select command and an ADOConnection as parameters.

[Visual Basic]

Sub CreateDataSetCommand ()
   Dim adoDataSetComm As ADODataSetCommand
   Dim mySelectComm As String
   Dim myConnection As String
   Dim myADOConnect As ADOConnection
   ' Set myConnection to the connection text
   myConnection = "Provider=SQLADO.1;User ID=sa;PASSWORD=;" _
    + "Initial Catalog=Northwind;Data Source=vbsql7;"
   ' Set mySelectComm to the select command text
   mySelectComm = "SELECT intID, vchFirstName, vchLastName " _
    + "FROM Customers"
   ' Initialize myADOConnect as a new object
   myADOConnect = New ADOConnection myConnection
   ' Initialize adoDataSetComm as a new object
   adoDataSetComm = new ADODataSetObject mySelectComm, myADOConnect
   ' Set the action to take when a table or column is missing
   adoDataSetComm.MissingSchemaAction = MissingSchemaAction.Add
End Sub

See Also

ADODataSetCommand Class | ADODataSetCommand Members | System.Data.ADO Namespace | ADODataSetCommand Constructor Overload List | MissingMappingAction | MissingSchemaAction