ADO.NET Object Model

only for RuBoard
Figure B.2. The ADO.NET Document Object Model.
graphics/bfig02.gif

ADO.NET DbTypes

Table B.1. SqlDbType Compared to OleDbType
SqlDbType OleDbType Description
BigInt BigInt

Int64 ” A 64-bit signed integer.

Binary Binary

Array of type Byte ” A fixed-length stream of binary data ranging between 1 and 8,000 bytes.

Bit -

Boolean ” An unsigned numeric value that can be 0, 1, or a null reference (Nothing in Visual Basic).

- Boolean

Boolean ” A boolean value ( DBTYPE_BOOL ).

- BSTR

String ” A null- terminated character string of Unicode characters ( DBTYPE_BSTR ).

Char Char

String ” A fixed-length stream of non-Unicode characters ranging between 1 and 8,000 characters.

DateTime Date

DateTime ” Date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds .

- DBDate

DateTime ” Date data in the format yyyymmdd ( DBTYPE_DBDATE ).

  DBTime

TimeSpan ” Time data in the format hhmmss ( DBTYPE_DBTIME ).

Decimal Decimal

Decimal ” A fixed precision and scale numeric value between “10E38 “1 and 10E38 “1.

- Empty

Empty ” No value ( DBTYPE_EMPTY ).

- Error

Exception ” A 32-bit error code ( DBTYPE_ERROR ).

- Filetime

DateTime ” A 64-bit unsigned integer representing the number of 100- nanosecond intervals since January 1, 1601 ( DBTYPE_FILETIME ).

Float Double

Double ” A floating point number within the range of “1.79E +308 through 1.79E +308.

Image -

Array of type Byte ” A variable-length stream of binary data ranging from 0 to 2E31 “1(or 2,147,483,647) bytes.

Int Integer

Int32 ” A 32-bit signed integer.

- LongVarBinary

Array of type Byte ” A long binary value ( OleDbParameter only).

- LongVarWChar

String ” A long string value ( OleDbParameter only).

- Numeric

Decimal ” An exact numeric value with a fixed precision and scale ( DBTYPE_NUMERIC ).

Money Currency

Decimal ” Currency value ranging from “2E63 (or “922,337,203,685,477.5808) to 2E63 “1(or +922,337,203,685,477.5807) with an accuracy to a ten-thousandth of a currency unit.

NChar -

String ” A fixed-length stream of Unicode characters ranging between 1 and 4,000 characters.

NText -

String ” A variable-length stream of Unicode data with a maximum length of 2E30 “1 (or 1,073,741,823) characters.

NVarChar -

String ” A variable-length stream of Unicode characters ranging between 1 and 4,000 characters. Note: Implicit conversion fails if the string is greater than 4,000 characters. Explicitly set the object when working with strings longer than 4,000 characters.

- PropVariant

Object ” An automation PROPVARIANT ( DBTYPE_PROP_VARIANT ).

Real Single

Single ” A floating point number within the range of “3.40E +38 through 3.40E +38.

SmallDateTime -

DateTime ” Date and time data ranging in value from January 1, 1900 to June 6, 2079 to an accuracy of one minute.

SmallInt SmallInt

Int16 ” A 16-bit signed integer.

SmallMoney -

Decimal ” A currency value ranging from “214,748.3648 to +214,748.3647 with an accuracy to a ten-thousandth of a currency unit.

Text LongVarChar

String ” A variable-length stream of non-Unicode data with a maximum length of 2E31 “1(or 2,147,483,647) characters.

Timestamp DBTimestamp

DateTime ” Date and time data in the format yyyymmddhhmmss.

TinyInt TinyInt

Byte ” An 8-bit unsigned integer.

UniqueIdentifier Guid

Guid ” A globally unique identifier (or GUID).

- UnsignedBigInt

UInt64 ” A 64-bit unsigned integer ( DBTYPE_UI8 ).

- UnsignedInt

UInt32 ” A 32-bit unsigned integer ( DBTYPE_UI4 ).

- UnsignedSmallInt

UInt16 ” A 16-bit unsigned integer ( DBTYPE_UI2 ).

- UnsignedTinyInt

UInt8 ” An 8-bit unsigned integer ( DBTYPE_UI1 ).

VarBinary VarBinary

Array of type Byte ” A variable-length stream of binary data ranging between 1 and 8,000 bytes. Note: Implicit conversion fails if the byte array is greater than 8,000 bytes. Explicitly set the object when working with byte arrays larger than 8,000 bytes.

VarChar VarChar

String ” A variable-length stream of non-Unicode characters ranging between 1 and 8,000 characters.

Variant Variant

Object ” A special data type that can contain numeric, string, binary, or date data as well as the SQL Server values Empty and Null, which is assumed if no other type is declared.

- VarNumeric

Decimal ” A variable-length numeric value ( OleDbParameter only).

- VarWChar

String ” A variable-length, null- terminated stream of Unicode characters ( OleDbParameter only).

- WChar

String ” A null-terminated stream of Unicode characters ( DBTYPE_WSTR ).

ASP.NET DataSet

Table B.2. DataSet Properties
Property Get/Set Description
CaseSensitive Get and Set Gets or sets a value indicating whether string comparisons within DataTable objects are case-sensitive.
Container Get Gets the container for the component.
DataSetName Get and Set Gets or sets the name of the current DataSet .
DefaultViewManager Get Gets a custom view of the data contained by the DataSet that allows filtering, searching, and navigating using a custom DataViewManager .
DesignMode Get Gets a value indicating whether the component is currently in design mode.
EnforceConstraints Get and set Gets or sets a value indicating whether constraint rules are followed when attempting any update operation.
ExtendedProperties Get Gets the collection of custom user information.
HasErrors Get Gets a value indicating whether there are errors in any of the rows in any of the tables of this DataSet .
Locale Get and Set Gets or sets the locale information used to compare strings within the table.
Namespace Get and Set Gets or sets the namespace of the DataSet .
Prefix Get and Set Gets or sets an XML prefix that aliases the namespace of the DataSet .
Relations Get Gets the collection of relations that link tables and allow navigation from parent tables.
Site Get and Set Overridden. Gets or sets an System.ComponentModel.ISite for the DataSet.
Tables Get Gets the collection of tables contained in the DataSet .
Table B.3. DataSet Public Instance Methods
Method Description
AcceptChanges Commits all of the changes made to this DataSet since it was loaded or the last time AcceptChanges was called.
BeginInit Begins the initialization of a DataSet that is used on a form or by another component. The initialization occurs at runtime.
Clear Clears the DataSet of any data by removing all rows in all tables.
Clone Clones the structure of the DataSet , including all DataTable schemas, relations, and constraints.
Copy Copies both the structure and data for this DataSet .
Dispose Overloaded. Releases the resources used by the MarshalByValueComponent .
EndInit Ends the initialization of a DataSet that is used on a form or by another component. The initialization occurs at runtime.
Equals Overloaded. Determines whether two Object instances are equal.
GetChanges Overloaded. Gets a copy of the DataSet containing all changes made to it since it was last loaded, or since AcceptChanges was called.
GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetService Gets the implementer of the IServiceProvider .
GetType Gets the Type of the current instance.
GetXml Returns the XML representation of the data stored in the DataSet .
GetXmlSchema Returns the XSD schema for the XML representation of the data stored in the DataSet .
HasChanges Overloaded. Gets a value indicating whether the DataSet has changes, including new, deleted, or modified rows.
InferXmlSchema Overloaded. Infers the XML schema from the specified TextReader or file into the DataSet .
Merge Overloaded. Merges this DataSet with a specified DataSet .
ReadXml Overloaded. Reads XML schema and data into the DataSet.
ReadXmlSchema Overloaded. Reads an XML schema into the DataSet .
RejectChanges Rolls back all the changes made to the DataSet since it was created, or since the last time DataSet.AcceptChanges was called.
Reset Resets the DataSet to its original state. Subclasses should override Reset to restore a DataSet to its original state.
ToString Returns a String that represents the current Object .
WriteXml Overloaded. Writes XML schema and data from the DataSet .
WriteXmlSchema Overloaded. Writes the DataSet structure as an XML schema.

ASP.NET DataTable

Table B.4. DataTable Properties
Property Get/Set Description
CaseSensitive Get and Set Indicates whether string comparisons within the table are case-sensitive.
ChildRelations Get Gets the collection of child relations for this DataTable .
Columns Get Gets the collection of columns that belong to this table.
Constraints Get Gets the collection of constraints maintained by this table.
Container Get Gets the container for the component.
DataSet Get Gets the DataSet to which this table belongs.
DefaultView Get Gets a customized view of the table, which can include a filtered view or a cursor position.
DesignMode Get Gets a value indicating whether the component is currently in design mode.
DisplayExpression Get and Set Gets or sets the expression that will return a value used to represent this table in UI.
ExtendedProperties Get Gets the collection of custom user information.
HasErrors Get Gets a value indicating whether there are errors in any of the rows in any of the tables of the DataSet to which the table belongs.
Locale Get and Set Gets or sets the locale information used to compare strings within the table.
MinimumCapacity Get and Set Gets or sets the initial starting size for this table.
Namespace Get and Set Gets or sets the namespace for the DataTable .
ParentRelations Get Gets the collection of parent relations for this DataTable .
Prefix Get and Set Gets or sets the namespace for the XML representation of the data stored in the DataTable .
PrimaryKey Get and Set Gets or sets an array of columns that function as primary keys for the data table.
Rows Get Gets the collection of rows that belong to this table.
Site Get and Set Overridden. Gets or sets an System.ComponentModel.Site for the DataTable .
TableName Get and Set Gets or sets the name of the DataTable .
Table B.5. DataTable Public Instance Methods
Method Description
AcceptChanges Commits all the changes made to this table since the last time AcceptChanges was called.
BeginInit Begins the initialization of a DataTable that is used on a form or used by another component. The initialization occurs at runtime.
BeginLoadData Turns off notifications, index maintenance, and constraints while loading data.
Clear Clears the DataTable of all data.
Clone Clones the structure of the DataTable , including all DataTable schemas, relations, and constraints.
Compute Computes the given expression on the current rows that pass the filter criteria.
Copy Copies both the structure and the data for this DataTable .
Dispose Overloaded. Releases the resources used by the MarshalByValueComponent .
EndInit Ends the initialization of a DataTable that is used on a form or used by another component. The initialization occurs at runtime.
EndLoadData Turns off notifications, index maintenance, and constraints while loading data.
Equals Overloaded. Determines whether two Object instances are equal.
GetChanges Overloaded. Gets a copy of the DataTable containing all changes made to it since it was last loaded, or since AcceptChanges was called.
GetErrors Gets an array of DataRow objects that contain errors.
GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetService Gets the implementer of the IServiceProvider .
GetType Gets the Type of the current instance.
ImportRow Copies a DataRow , including original and current values, DataRowState values, and errors, into a DataTable .
LoadDataRow Finds and updates a specific row. If no matching row is found, a new row is created using the given values.
NewRow Creates a new DataRow with the same schema as the table.
RejectChanges Rolls back all changes that have been made to the table since it was loaded, or the last time AcceptChanges was called.
Select Overloaded. Gets an array of DataRow objects.
ToString Overridden. Gets the TableName and DisplayExpression , if there is one as a concatenated string.

RowStates of a DataRow

Table B.6. DataRow.RowState (uses DataRowState enumeration)
RowState Description
Added The row has been added to a DataRowCollection , and AcceptChanges has not been called.
Deleted The row was deleted using the Delete method of the DataRow .
Detached The row has been created but is not part of any DataRowCollection . A DataRow is in this state immediately after it has been created and before it is added to a collection, or if it has been removed from a collection.
Modified The row has been modified and AcceptChanges has not been called.
Unchanged The row has not changed since AcceptChanges was last called.

DataColumn ForeignKeyContraint

Table B.7. ForeignKeyConstraint (uses Rule enumeration)
Action Description
Cascade Delete or update related rows. This is the default.
None No action taken on related rows.
SetDefault Set values in related rows to the value contained in the DefaultValue property.
SetNull Set values in related rows to DBNull .
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