Sybase Data Provider Classes
- Last Updated: April 16, 2026
- 15 minute read
- ADO.NET
- Documentation
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
The following table 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.
Public Properties of the SybaseCommand Class
| Property | Description |
| ArrayBindCount | Specifies the number of rows of parameters that will be used. The application must set this property before executing a command that uses parameter array binding. The count must equal the length of each of the arrays that is set for each parameter value. When set to 0 (the initial default), the application does not use parameter array binding. Note: The application cannot influence this bind count on top of the ADO.NET Entity Framework. |
| ArrayBindStatus | Specifies the method the application uses to inspect the per row status after executing a command using parameter array binding. The property's type is an array of SybaseRowStatus. Parameter arrays are emulated. The data provider issues each statement individually. The SybaseRowStatus enumeration has the following possible values:
|
| CommandTimeout | Gets or sets the wait time before terminating the attempt to execute a command and generating an error. The initial default is 30 seconds. We recommend that the application sets the CommandTimeout property to a value that is greater than the largest default timeout value on the server. This ensures that the application gets a more meaningful reply in case of a timeout. |
| FetchBufferSize | Allows you to override the Sybase connection string option Fetch Buffer Size on a per-command basis. If no value is set, the data provider uses the value specified on the SybaseConnection class. |
| RowSetSize | Limits the number of rows returned by any query executed on this Command object to the value specified at execution time. Valid values are 0 to 2147483647. When set to 0 (the initial default), the data provider does not limit the number of rows returned. |
| StatementCacheBehavior | Retrieves or sets the statement cache behavior of the Command class to one of the values of the StatementCacheBehavior enumeration. See Enabling Statement Caching for more information. When set to Implicit (the default) and the Statement Cache Mode connection string option is set to Auto, statement caching occurs implicitly. When set to Cache and the Statement Cache Mode connection string option is set to ExplicitOnly, statements identified as Cache are cached. When set to DoNotCache, statement caching does not occur. |
| UpdatedRowSource | Gets or sets how command results are applied to the DataRow, when used by the Update method of a DataAdapter. When the UpdateBatchSize property is set to a value other than 1, the UpdatedRowSource property for UpdateCommand, DeleteCommand, and InsertCommand must be set to None or OutputParameters. When set to None, any returned parameters or rows are ignored. When set to OutputParameters, output parameters are mapped to the changed row in the DataSet. |
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
The following table lists the provider-specific public constructors of the SybaseConnection class.
Public Constructors of the SybaseConnection Class
| Constructor | Description |
| SybaseConnection() | Initializes a new instance of the SybaseConnection class. |
| SybaseConnection(string connectionString) | Initializes a new instance of the SybaseConnection class when given a string that contains the connection string. |
| SybaseConnection(string connectionString, SybaseCredential credential) | Initializes a new instance of the SybaseConnection class given a connection string and a SybaseCredential object that contains the user ID and password. |
The following table 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.
Public Properties of the SybaseConnection Class
| Property | Description |
| ApplicationName | Returns the value specified for the Application Name connection string option. Read-only. |
| ClientHostName | Specifies the name that the Sybase server uses to identify the client workstation name. This sets the clienthostname and hostname column values in the sysprocesses table. This property is an alias for the WorkstationID property. |
| CloneConnectionIfNeeded | Returns the value specified for the Clone Connection If Needed connection string option. Read-only. |
| ConnectionString | Gets or sets the string used to open a database. See Connection String Options for a description of the values you can set. |
| Credential | Provides a more secure way to specify the password for connecting to Sybase Server. SybaseCredential is comprised of a user id and a password that will be used for connecting to Sybase Server. The SecureString object which holds the password should be marked Read-Only. |
| Database | Returns the value specified for the Database connection string option. Read-only. |
| DatabaseCharacterSetName | Set by the ADO.NET data provider on connection with the IANA code page name for the character set in the database to which the data provider has connected. Read-only. Note: Not supported for the Entity Framework data provider. Instead, the data provider uses the ADO.NET Entity Framework programming contexts. |
| DatabaseName | Returns the value specified for the Database connection string option. Read-only. |
| DataSource | Gets the hostname of the Sybase server to which to connect. Read-only. |
| EnableQuotedIdentifiers | Returns the value specified for the Enable Quoted Identifiers connection string option. Read-only. |
| FetchBufferSize | Returns the value specified for the Fetch Buffer Size connection string option. Read-only. |
| Host | Gets the name of the host to which the data provider is connected. Read-only. The data provider predicts which host will be used for the connection, based on information in the connection string. If a change occurs during connection, for example, an alternate server is used, the Host property reports the actual host to which the data provider is connected. |
| InterfacesFile | Specifies the path or the URL of the Interfaces file. Note: If you do not specify a value for this property, but specify a value for the Server Name property, the data provider looks for the path of the Interfaces file in the Registry under HKEY_LOCAL_MACHINE\SOFTWARE\DataDirect\InterfacesFile. If this Registry value is empty, then the data provider attempts to open the SQL.INI file found in the same directory as the data provider and use it as the Interfaces file. |
| PacketSize | Returns the value specified for the Packet Size connection string option. Read-only. |
| Port | Gets the name of the Port used for the connection. Read-only. The data provider predicts which port will be used for the connection, based on information in the connection string. If a change occurs while the connection is being established, for example, an alternate server is used, the Port property reports the actual port to which the data provider is connected. |
| SelectMethod | Returns the value specified for the Select Method connection string option. Read-only. |
| ServerName | Returns the value specified for the Server Name connection string option. Read-only. |
| StatisticsEnabled | Enables statistics gathering for the current Connection object for the ADO.NET data provider. When set to True, statistics gathering is enabled for the current connection. Notes:
|
| Textsize | Returns the value specified for the Text Size connection string option. Read-only. |
| WorkstationID | Returns the value specified for the Workstation ID connection string option. Read-only. |
The following table 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.
Public Methods of the SybaseConnection Class
| Method | Description |
| BeginTransaction() | Begins a transaction at the Sybase database. When using the overloaded BeginTransaction(IsolationLevel) method, the Sybase data provider supports the following .NET Framework isolation levels: ReadCommitted (the default), ReadUncommitted, RepeatableRead, and Serializable. Refer to the DataDirect Connect Series for ADO.NET Reference for more information. |
| Close | Closes the connection to the database and returns the connection to the connection pool. The connection string settings remain as they were before the Open was called. The Microsoft .NET Framework SDK documentation notes that Close is the preferred method of closing a connection. |
| EnlistTransaction | Enlists in the specified transaction as a distributed transaction. The application can call the EnlistTransaction() method to enlist the connection in creating a thread’s current transaction context, instead of using the Enlist connection string option. SybaseConnection.EnlistTransaction(ITransaction); The application can call this method after connecting. The application may pass an ITransaction object to the function to enlist the connection in that transaction. If the ITransaction object is a null reference, the data provider uses the ITransaction in the current context. Notes:
|
| ResetStatistics | Resets all values to zero in the current statistics gathering session on the connection. When the connection is closed and returned to the connection pool, statistics gathering is switched off and the counts are reset. When the connection is closed and then reopened without calling the ResetStatistics method, statistics gathering continues without resetting the statistics counts. |
| RetrieveStatistics | 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. |
| SetOEMLicenseInfo | The SetOEMLicenseInfo method is for Progress DataDirect OEM customers using the ADO.NET data provider only. Refer to the DataDirect Connect Series for ADO.NET Distribution Guide. Note: This property is useful for standard ADO.NET applications. However, it is not accessible from the ADO.NET Entity Framework. Instead, the data provider uses the Entity Framework programming contexts. |
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.
SybaseCredential Class
SybaseCredential provides a more secure way to specify the password for connecting to Sybase server. SybaseCredential is comprised of a user id and a password that will be used for connecting to Sybase Server.
The password in a SybaseCredential object is of type SecureString, unlike Connection String where password remains unsecure till the point where provider reads it and converts it to SecureString. The password is converted to string/ byte array in a secured way so that the conversion logic does not write the password in the memory. Any string where password is stored is cleaned after use.
Note: SybaseCredential should not be used when the Authentication Method does not need user id and password. So, if you are using Kerberos, you should not use SybaseCredential.
Note: The Connection String should not have the User id and password when the Credential object is being used.
The following code snippet shows how the SybaseCredential class can be used:
SybaseConnection con = null;
SybaseCredential lobjCredential = null;
string userId = "ABCD";
SecureString password = ConvertToSecureString("XYXYX");
private static SecureString ConvertToSecureString(string value)
{
var securePassword = new SecureString();
foreach (char c in value.ToCharArray())
securePassword.AppendChar(c);
securePassword.MakeReadOnly();
return securePassword;
}
try
{
lobjCredential = new SybaseCredential(userId, password);
con = new SybaseConnection("Host=nc-xxx;Port=xxxx;Database Name=xxxx"", lobjCredential);
con.Open();
Console.WriteLine("Connection Successfully Opened...");
con.Close();
}
catch (Exception e)
{
Console.Write(e.Message)
}
finally
{
if (null != con)
{
con.Close();
con = null;
}
if (null != lobjCredential)
lobjCredential = null;
}
Note: The method followed to convert a string into a SecureString in this example is one of many possible methods you can use.
The following table lists the provider-specific implementation of the public properties of the SybaseConnection class.
Public Properties of the SybaseCredential Class
| Property | Description |
| User ID | Returns the user ID component of the SybaseCredential object. Uses String data type. Invalid Values - NULL or empty. |
| Password | Returns the password component of the SybaseCredential object. Uses SecureString data type. Invalid Values - NULL |
Note: If you are using Credential objects while opening the connection and want to use the same pooled connection, you need to use the same Credential object (Reference equal). Only then the same connection will be fetched from the available connection pool.
If you create a new Credential object for each connection, the driver will treat them as separate connection and put them into different connection pools. (Even if you use the same user id and password)
SybaseDataAdapter Class
The following table 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.
Supported Properties of the SybaseDataAdapter Class
| Property | Description |
| UpdateBatchSize | Gets or sets the number of commands that can be executed in a batch. If your application uses disconnected DataSets and updates those DataSets, you can positively influence performance by setting this property to a value greater than 1. By default, the data provider attempts to use the largest batch size possible. However, this may not equate to optimal performance for your application. The value you set depends on the number of rows you are typically updating in the DataSet. For example, if you are updating less than 50 rows, a suggested setting for this property is 25. When set to 0, the SybaseDataAdapter uses the largest batch size the data source can support. The UpdatedRowSource property for the UpdateCommand, DeleteCommand, and InsertCommand must be set to None or OutputParameters. When set to 1, batch updating is disabled. When set to a value greater than 1, the specified number of commands are executed in a batch. The UpdatedRowSource property for the UpdateCommand, DeleteCommand, and InsertCommand must be set to None or OutputParameters. |
The following table lists the public methods of the SybaseDataAdapter class.
Public Methods of the SybaseDataAdapter Class
| Method | Description |
| CreateRowUpdated | Initializes a new instance of the RowUpdatedEventArgs class, regardless of whether the Update is successful. |
| CreateRowUpdating | Initializes a new instance of the RowUpdatingEventArgs class. |
| OnRowUpdated | Raises the RowUpdated event. |
| OnRowUpdating | Raises the RowUpdating event. |
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
The following table 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.
Public Properties of the SybaseError Class
| Property | Description |
| SQLState | Returns the string representation of the SQL State when an exception is thrown by the Sybase data provider. This property is read-only. |
SybaseErrorCollection Class
The following table 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.
Public Properties of the SybaseErrorCollection Class
| Property | Description |
| IsSynchronized | Gets a value indicating whether the SybaseErrorCollection is synchronized (thread-safe). |
| SyncRoot | Gets the object used to synchronize access to the SybaseErrorCollection. |
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;
The following table 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.
Public Properties of the SybaseException Class
| Property | Description |
| ErrorPosition | Returns the offset in the SQL statement for which the error applies. The data provider returns 0 if the offset is not applicable to the error. |
| Number | Returns the numeric value associated with a specific error. |
| SQLState | Returns the string representation of the SQLState when an exception is thrown by the Sybase data provider. For example, if the data provider returns 28000, the authorization name is invalid. |
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.
The following table lists the static methods used to accommodate choosing the Sybase data provider and instantiating its DbProviderFactory.
Methods of the SybaseFactory Class
| Method | Description |
| CreateCommand | Returns a strongly typed DbCommand instance. |
| CreateCommandBuilder | Returns a strongly typed DbCommandBuilder instance. |
| CreateConnection | Returns a strongly typed DbConnection instance. |
| CreateConnectionStringBuilder | Returns a strongly typed DbConnectionString instance. |
| CreateDataAdapter | Returns a strongly typed DbDataAdapter instance. |
| CreateDataSourceEnumerator | Returns a strongly typed SybaseDataSourceEnumerator instance. |
| CreateParameter | Returns a strongly typed DbParameter instance. |
| CreateParameter | Returns a new CodeAccessPermission. |
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
The following table 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.
Public Properties of the SybaseParameter Class
| Property | Description |
| ArrayBindStatus | Determines whether any values in an array of SybaseParameterStatus entries should be bound as null. The SybaseParameterStatus enumeration contains the entry NullValue. When this property is not set, then no values are null. The length of the array should match the amount specified by the SybaseCommand class's ArrayBindCount property (see the ArrayBindCount property of the "SybaseCommand Class"). The initial default is null. |
| Precision | Gets or sets the maximum number of digits used to represent the Value property. Note: When using NUMERIC output parameters in a stored procedure, you must supply the correct precision. |
| Scale | Gets or sets the number of decimal places to which Value is resolved. Note: When using numeric output parameters in a stored procedure, you must supply the correct scale. |
| SybaseDbType | Gets or sets the Sybase type of the parameter. |
| Value | Gets or sets the value of the parameter. 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. To enable the use of streams as input to long data parameters, you set the Value property to a specific instance of the stream. See Using Streams as Input to Long Data Parameters for more information. |
SybaseParameterCollection
The following table 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.
Public Properties of the SybaseParameterCollection Class
| Property | Description |
| IsFixedSize | Gets a value that indicates whether the ParameterCollection has a fixed size. |
| IsReadOnly | Gets a value that indicates whether the ParameterCollection is read-only. |
| IsSynchronized | Gets a value that indicates whether the ParameterCollection is thread-safe. |
| SyncRoot | Gets the object used to synchronize access to the ParameterCollection. |
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;
The following table lists the public properties for the SybaseTrace class.
Public Properties of the SybaseTrace Class
| Property | Description |
| EnableTrace | When set to 1 or higher, enables tracing. When set to 0 (the initial default), tracing is disabled. |
| RecreateTrace | When set to 1, the trace file is re-created each time the application restarts. When set to 0 (the initial default), the trace file is appended. |
| TraceFile | Specifies the path and name of the trace file. The initial default is an empty string. If the file does not exist, the data provider creates it. |
| Note: Setting EnableTrace starts the tracing process. Therefore, you must define the property values for the trace file before setting EnableTrace. Once the trace processing starts, the values of TraceFile and RecreateTrace cannot be changed. | |
The following table lists the public methods for the SybaseTrace class.
Public Methods of the SybaseTrace Class
| Method | Description |
| DumpFootprints | Displays the footprint of all source files in a data provider. |
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.