SAFactory class

Represents a set of methods for creating instances of the iAnywhere.Data.SQLAnywhere provider's implementation of the data source classes. This is a static class and so cannot be inherited or instantiated.

Syntax
Visual Basic

Public NotInheritable Class SAFactory 
  Inherits DbProviderFactory
  Implements IServiceProvider
C#

public sealed class SAFactory : DbProviderFactory,
  IServiceProvider
Remarks

There is no constructor for SAFactory.

ADO.NET 2.0 adds two new classes, DbProviderFactories and DbProviderFactory, to make provider independent code easier to write. To use them with SQL Anywhere specify iAnywhere.Data.SQLAnywhere as the provider invariant name passed to GetFactory. For example:

' Visual Basic
Dim factory As DbProviderFactory = _
  DbProviderFactories.GetFactory( "iAnywhere.Data.SQLAnywhere" )
Dim conn As DbConnection = _
  factory.CreateConnection()
// C#
DbProviderFactory factory = 
        DbProviderFactories.GetFactory("iAnywhere.Data.SQLAnywhere" );
DbConnection conn = factory.CreateConnection();

In this example, conn is created as an SAConnection object.

For an explanation of provider factories and generic programming in ADO.NET 2.0, see [external link] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/vsgenerics.asp.

Restrictions: The SAFactory class is not available in the .NET Compact Framework 2.0.

Inherits: [external link] DbProviderFactory

See also

SAFactory members
Instance field
CanCreateDataSourceEnumerator property
CreateCommand method
CreateCommandBuilder method
CreateConnection method
CreateConnectionStringBuilder method
CreateDataAdapter method
CreateDataSourceEnumerator method
CreateParameter method
CreatePermission method