ASP.NET Managed Providers

only for RuBoard
Figure B.3. Managed Providers are the bridge from a data store to a .NET application.
graphics/bfig03.gif

ASP.NET Managed Connection

Table B.8. Managed Connection Properties
Property Get/Set Description
ConnectionString Get and Set Gets or sets the string used to open a SQL Server database.
ConnectionTimeout Get and Set Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
Container Get Returns the IContainer that contains the Component .
Database Get Gets the name of the current database or the database to be used once a connection is open.
DataSource Get Gets the name of the instance of SQL Server to which to connect.
PacketSize (SQL Managed Provider) Get and Set Gets the size (in bytes) of network packets used to communicate with an instance of SQL Server.
Provider (OleDB Managed Provider) Get and Set Gets or sets the name of the OLE DB provider.
ServerVersion Get Gets a string containing the version of the instance of SQL Server to which the client is connected.
Site Get and Set Gets or sets the site of the Component .
State Get Gets the current state of the connection.
WorkstationId (SQL Managed Provider) Get Gets a string that identifies the database client.

The Managed Command Object Model

The Managed Command ( SqlCommand and OleDbCommand )
Table B.9. Managed Command Properties
Property Get/Set Description
CommandText Get and Set Gets or sets the Transact -SQL statement or stored procedure to execute at the data source.
CommandTimeout Get and Set Gets or sets the wait time before terminating the attempt to execute a command and generating an error.
CommandType Get and Set Gets or sets a value indicating how the CommandText property is interpreted.
Connection Get and Set Gets or sets the SqlConnection or OleDbConnection used by this instance of the command.
Contain er Get Returns the IContainer that contains the component.
DesignTimeVisible Get and Set Gets or sets a value indicating whether the command object should be visible in a Windows Forms Designer control.
Parameters Get Gets the SqlParametersCollection or OleDbParametersCollection .
Site Get and Set Gets or sets the site of the Component .
Transaction Get and Set Gets or sets the transaction in which the SqlCommand or OleDbCommand executes.
UpdatedRowSource Get and Set Gets or sets how command results are applied to the DataRow when used by the Update method of the DbDataAdapter .
Table B.10. Managed Command Public Instance Methods
Method Description
Cancel Cancels the execution of a command.
CreateParameter Creates a new instance of a SqlParameter or OleDbParameter object.
Dispose Overloaded. Releases the resources used by the Component .
Equals Overloaded. Determines whether two Object instances are equal.
ExequteNonQuery Executes a Transact-SQL statement against the Connection and returns the number of rows affected.
ExecuteReader Overloaded. Sends the CommandText to the Connection and builds a DataReader .
ExecuteScalar Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.
ExecuteXmlReader ( SqlCommand only) Sends the CommandText to the Connection and builds an XmlReader object.
GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService Returns a lifetime service object that is used to control the lifetime policy to the object.
GetType Gets the Type of the current instance.
InitializeLifetimeService Objects can provide their own lease and so control their own lifetime. They do this by overriding the InitializeLifetimeService method provided on MarshalByRefObject .
Prepare Creates a prepared (or compiled) version of the command on the data source.
ResetCommandTimeout Resets the CommandTimeout property to the default value.
ToString Returns a String that represents the current Object .

The DataAdapter Object Model

The DataAdapter ( SqlDataAdapter and OleDbDataAdapter )
Table B.11. DataAdapter Properties
Property Get/Set Description
AcceptChangesDuringFill Get and Set Gets or sets a value indicating whether AcceptChanges is called on the DataRow after it is added to the DataTable .
Container Get Returns the IContainer that contains the Component .
DeleteCommand Get and Set Gets or sets a Transact-SQL statement to delete records from the data set.
InsertCommand Get and Set Gets or sets a Transact-SQL statement to insert new records into the data source.
MissingMappingAction Get and Set Determines the action to take when incoming data does not have a matching table or column.
MissingSchemaAction Get and Set Determines the action to take when existing DataSet schema does not match incoming data.
SelectCommand Get and Set Gets or sets a Transact-SQL statement used to select records in the data source.
Site Get and Set Gets or sets the site of the Component .
TableMappings Get Gets a collection that provides the master mapping between a source table and a DataTable .
UpdateCommand Get and Set Gets or sets a Transact-SQL statement used to update records in the data source.
Figure B.4. The DataAdapter Object Model.
graphics/bfig04.gif
Table B.12. DataAdapter Public Instance Methods
Method Description
Dispose Overloaded. Releases the resources used by the Component .
Equals Overloaded. Determines whether two Object instances are equal.
Fill Overloaded. Overridden. Adds or refreshes rows in the DataSet to match those in the data source.
FillSchema Overloaded. Overridden. Adds a DataTable to a DataSet and configures the schema to match that in the data source.
GetFillParameters Overridden. Gets the parameters set by the user when executing an SQL SELECT statement.
GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService Retrieves a lifetime service object that controls the lifetime policy for this instance. For the default Lifetime service this will be an object of type ILease .
GetType Gets the Type of current instance.
InitializeLifetimeService Objects can provide their own lease and so control their own lifetime. They do this by overriding the InitializeLifetimeService method provided on MarshalByRefObject .
ToString Returns a String that represents the current Object
Update Overloaded. Calls the respective INSERT , UPDATE , or DELETE statements for each inserted, updated, or deleted row in the DataSet from a DataTable named "Table".
only for RuBoard


Programming Data-Driven Web Applications with ASP. NET
Programming Data-Driven Web Applications with ASP.NET
ISBN: 0672321068
EAN: 2147483647
Year: 2000
Pages: 170

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net