System.Data.SqlClient Namespace SqlDataAdapter Class
Initializes a new instance of the SqlDataAdapter class.
[ VB ]
Overloads Public Sub New ( )
[ C# ]
public SqlDataAdapter ( );
[ C++ ]
public: SqlDataAdapter ( );
[ JScript ]
public function SqlDataAdapter ( );
When an instance of SqlDataAdapter is created, the following read/write properties are set to initial values.
You can change the value of any of these properties through a separate call to the property.
The following example initializes an SqlDataAdapter using this constructor, then sets some of its properties.
// set up the connection
SqlConnection myConn = new SqlConnection (
"server=localhost; trusted_connection=yes; database=pubs" );
// set up the dataadapter
SqlDataAdapter myAdapter = new SqlDataAdapter ( );
myAdapter.SelectCommand.CommandText = "SELECT * FROM authors";
myAdapter.SelectCommand.Connection = myConn;
' set up the connection
dim myConn as new SqlConnection (
"server=localhost; trusted_connection=yes; database=pubs" );
' set up the dataadapter
dim myAdapter as new SqlDataAdapter ( )
myAdapter.SelectCommand.CommandText = "SELECT * FROM authors"
myAdapter.SelectCommand.Connection = myConn |
|
C# |
VB |
SqlDataAdapter Members SqlDataAdapter Constructor Overload List MissingMappingAction MissingSchemaAction