SqlDataAdapter Constructor (SqlCommand)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the SqlDataAdapter class with the specified SqlCommand as the SelectCommand property.

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

new : 
        selectCommand:SqlCommand -> SqlDataAdapter


Type: System.Data.SqlClient.SqlCommand

A SqlCommand that is a Transact-SQL SELECT statement or stored procedure and is set as the SelectCommand property of the SqlDataAdapter.

This implementation of the SqlDataAdapter constructor sets the SelectCommand property to the value specified in the selectCommand parameter.

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


Initial value





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

When SelectCommand (or any of the other command properties) is assigned to a previously created SqlCommand, the SqlCommand is not cloned. The SelectCommand maintains a reference to the previously created SqlCommand object.

The following example creates a SqlDataAdapter and sets some of its properties.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top