图生活吧

博客园 首页 新随笔 联系 订阅 管理

修改DBType,增加OleDb。

enum DBType
{
    OleDb,
    SqlServer,
    SqlServerCE,
    MySql,
    PostgreSQL,
    Oracle,
    SQLite
}

修改CommonConstruct,增加if (dbtype.StartsWith("OleDb")) _dbType = DBType.OleDb;

private void CommonConstruct()
{
    if (dbtype.StartsWith("OleDb")) _dbType = DBType.OleDb;
    else if (dbtype.StartsWith("MySql")) _dbType = DBType.MySql;
    else if (dbtype.StartsWith("SqlCe")) _dbType = DBType.SqlServerCE;
    else if (dbtype.StartsWith("Npgsql")) _dbType = DBType.PostgreSQL;
    else if (dbtype.StartsWith("Oracle")) _dbType = DBType.Oracle;
    else if (dbtype.StartsWith("SQLite")) _dbType = DBType.SQLite;
    else if (dbtype.StartsWith("System.Data.SqlClient.")) _dbType = DBType.SqlServer;
}

调用:

Dim db As Database = New Database(cs, "System.Data.OleDb")

  

posted on 2012-11-02 11:07  图生活吧  阅读(705)  评论(0编辑  收藏  举报