C .NET Classes : Sybase Data Provider Class

Sybase Data Provider Class
The Sybase data provider supports the public classes, properties, and methods as described in the Microsoft .NET Framework SDK documentation. The Sybase data provider attaches the provider-specific prefix "Sybase" to the public .NET classes, for example, SybaseCommand.
This section describes the provider-specific properties and methods of the Sybase data provider.
SybaseBulkCopy
The SybaseBulkCopy class uses a model similar to the Microsoft SqlBulkCopy class, and has no provider-specific properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
SybaseBulkCopyColumnMapping
The SybaseBulkCopyColumnMapping class uses an API pattern similar to the ADO.NET Bulk API patterns, and has no provider-specific public properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
SybaseBulkCopyColumnMappingCollection
The SybaseBulkCopyColumnMapping class follows an API pattern similar to the Microsoft SqlBulkCopyColumnMappingCollection class, and has no provider-specific public properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
SybaseCommand Class
Table C-41 lists the provider-specific public properties of the SybaseCommand class. The table includes the generic public properties of the Command class when provider-specific information supplements the standard descriptions. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
 
SybaseCommandBuilder Class
Using a CommandBuilder class can have a negative effect on performance. Because of concurrency restrictions, the CommandBuilder can generate highly inefficient SQL statements. The end user can often write more efficient Update and Delete statements than those that the CommandBuilder generates.
The SybaseCommandBuilder class has no provider-specific public properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
SybaseConnection Class
Table C-42 lists the provider-specific public properties of the SybaseConnection class. The table includes the generic public properties of the Connection class when provider-specific information supplements the standard descriptions. Some properties return the values specified for the corresponding connection string option. See “Sybase Data Provider Connection String Options” for more information.
 
Table C-43 lists the provider-specific public methods supported for the SybaseConnection class. For information about other methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
 
Retrieves a set of statistics for a connection that is enabled for statistics gathering (see the StatisticsEnabled property). The set of name=value pairs returned forms a "snapshot in time" of the state of the connection when the method is called. You can retrieve all of the statistical items, or only the specific items that you want.
SybaseConnectionStringBuilder Class
TheSybaseConnectionStringBuilder class has no provider-specific public methods. For information about the methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
TheSybaseConnectionStringBuilder property names are the same as the connection string option names of the SybaseConnection class. However, the connection string option name has spaces between the words. For example, the connection string option name Alternate Servers is equivalent to the property name AlternateServers.
See “Sybase Data Provider Connection String Options” for the connection option descriptions, which are listed alphabetically by the connection string option name. The ConnectionStringBuilder property name is listed immediately underneath the GUI name.
SybaseDataAdapter Class
Table C-44 lists the provider-specific implementation of the public properties of the SybaseDataAdapter class. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
 
Table C-45 lists the public methods of the SybaseDataAdapter class.
 
SybaseDataReader Class
The SybaseDataReader class has no provider-specific properties or methods. For a description of the properties and methods supported, refer to the data provider’s online help.
SybaseError Class
Table C-46 lists the provider-specific public properties of the SybaseError class. For a description of other properties supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
 
SybaseErrorCollection Class
Table C-47 describes the provider-specific public properties supported by the SybaseErrorCollection class. For a description of other properties and methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
 
SybaseException Class
Provider-specific exceptions are derived directly from the System.Data interface. Only the public properties and methods, for example, the Message property, are directly available on the System.Exception object in a generic sense. The SQLState and Number properties are only accessible through provider-specific code or by using reflection.
ADO.NET 2.0 introduced the Data property on the DbException class. This property returns a collection of key-value pair tuples that provide additional user-defined information about an exception. The Sybase data provider gets a collection of key/value pairs such as SQLState, Number, and ErrorPosition.
The DDTek prefix is applied to each key, for example:
DDTek.Data["SQLState"] = 28000;
Table C-48 lists the provider-specific public properties of the SybaseException class. The properties apply to the last error collected if multiple errors occurred. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
 
SybaseFactory Class
Provider Factory classes allow users to program to generic classes. Once instantiated from DbProviderFactory, the factory generates the proper type of concrete class.
Table C-49 lists the static methods used to accommodate choosing the Sybase data provider and instantiating its DbProviderFactory.
 
SybaseInfoMessageEventArgs Class
The SybaseInfoMessageEventArgs class is passed as an input to the SybaseInfoMessageEventHandler and contains information relevant to a warning generated by the Sybase server.
The SybaseInfoMessageEventArgs class has no provider-specific public properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
SybaseParameter Class
Table C-50 lists the provider-specific public properties of the SybaseParameter class. The table includes the generic public properties of the Parameter class when provider-specific information supplements the standard descriptions. For a description of other properties and methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
NOTE: When executing a stored procedure, the data provider by default assumes that the parameters supplied are in the same order as they were specified in the Create Procedure statement. The names of parameters supplied in the SybaseParameter class are ignored.
 
This property is specified as an array of values when array binding is enabled (see the ArrayBindCount property of the “SybaseCommand Class”). Each array's length must match the value of the ArrayBindCount property. When specifying the array's values for binary type columns, the data will actually be specified as byte[]. This is an array of arrays of bytes. The data provider anticipates a jagged array as such when using parameter array binding with parameters.
SybaseParameterCollection
Table C-51 lists the provider-specific public properties of the SybaseParameterCollection class. For a description of other properties and methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
 
SybaseTrace Class
The SybaseTrace class is created by the application to debug problems during development. Setting the properties in the SybaseTrace class overrides the settings of the environment variables. See “Connection String Options” for more information. For your final application, be sure to remove references to the SybaseTrace class.
The following code fragment creates a SybaseTrace class with a trace file named MyTrace.txt. All subsequent calls to the data provider will be traced to that file.
SybaseTrace.TraceFile="C:\\MyTrace.txt";
SybaseTrace.RecreateTrace = 1;
SybaseTrace.EnableTrace = 1;
Table C-52 lists the public properties for the SybaseTrace class.
Table C-53 lists the public methods for the SybaseTrace class.
 
SybaseTransaction Class
The SybaseTransaction class has no provider-specific public properties or methods. For a description of the properties and methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.