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!

SQLDataSetCommand Constructor (SQLCommand)

Initializes a new instance of the SQLDataSetCommand class with the specified select command.

[Visual Basic]
Overloads Public Sub New( _
   ByVal selectCommand As SQLCommand _
)
[C#]
public SQLDataSetCommand(
   SQLCommand selectCommand
);
[C++]
public: SQLDataSetCommand(
   SQLCommand* selectCommand
);
[JScript]
public function SQLDataSetCommand(
   selectCommand : SQLCommand
);

Parameters

selectCommand
An SQLCommand that is a select command.

Remarks

When an instance of SQLDataSetCommand is created, the following read/write properties are set to initial values.

Properties Initial Value
SelectCommand A new SQLCommand that is a copy of selectCommand.
InsertCommand A new SQLCommand.
DeleteCommand A new SQLCommand.
UpdateCommand A new SQLCommand.
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 creates a SQLDataSetCommand with an SQLCommand that is a select command as a parameter.

[Visual Basic]

Sub CreateDataSetCommand ()
    Dim sqlDataSetComm As SQLDataSetCommand
    Dim myConnection As String
    Dim mySelectComm As String
    Dim mySQLSelect As SQLCommand
    ' Set myConnection to the connection string text
    myConnection = "Provider=SQLSQL.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 mySQLSelect command as a new object
    mySQLSelect = New SQLCommand mySelectComm myConnection
    ' Initialize sqlDataSetComm as a new object
    sqlDataSetComm = New SQLDataSetCommand mySQLSelect
End Sub

See Also

SQLDataSetCommand Class | SQLDataSetCommand Members | System.Data.SQL Namespace | SQLDataSetCommand Constructor Overload List | MissingMappingAction | MissingSchemaAction