public void InitDb(DataType dbtype, string connstr) { this.DbContext = new DbContext(connstr); switch (dbtype) { case DataType.Oledb: connstr = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + connstr; DbContext.ConnStr = connstr; DbContext.DbProvider = new OleDbProvider(); break; case DataType.Mssql: DbContext.DbProvider = new SqlProvider(); break; case DataType.Mysql: DbContext.DbProvider = new MySqlProvider(); break; default: throw new ArgumentException("未支持的provider:" + dbtype.ToString(), "provider"); } if (_da == null) { _da = new NjhDataSqlExecutor(this.DbContext); } }
public NjhDataEntityOPerationMsSql(NjhDataSqlExecutor executor) { this._executor = executor; }
public OledbEntityOperation(NjhDataSqlExecutor factory) { this.conn = (OleDbConnection)factory.CreateConnection(); this._executor = factory; }