Implement a sybase provider factory

Topics: Data Access Application Block
Apr 24, 2009 at 11:06 PM
I´m want to implement sybase provider factory support to some applications. Currently I have AseDatabase(sysbase system 12).
the current sql provider factory work fine.

but i don't know some guideline to star point.
I try adding a reference to Sybase.Data.AseClient into my application, set the Connection string in app.config
but don't run the samples(retrieve records with a storeprocedure).

How I can solved this issue? Any idea or suggestion?

these are my current sql provider factory c# classes code :

//Creates and prepares a new DbCommand object on
    //a new connection
    public static DbCommand CreateCommand()
    {
        //Obtain the database provider name
        string dataProviderName = WebStoreXConfiguration.DbProviderName;
        //Obtain the database connection string
        string connectionString = WebStoreXConfiguration.DbConnecctionString;
        //Create a new data provider factory
        DbProviderFactory factory = DbProviderFactories.GetFactory(dataProviderName);
        //Obtain a database specific connecction object
        DbConnection conn = factory.CreateConnection();
        //Set the connection string
        conn.ConnectionString = connectionString;
        //Create a database specific command object
        DbCommand comm = conn.CreateCommand();
        //Set the command type to stored procedure
        comm.CommandType = CommandType.StoredProcedure;
        //Return the initialized command object
        return comm;
    }

thanks for your help,.
Apr 27, 2009 at 11:20 AM
Please see this related post:

http://entlib.codeplex.com/Thread/View.aspx?ThreadId=51064
http://entlib.codeplex.com/Thread/View.aspx?ThreadId=48745

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com