public DataSet SelectPreguntasByExcel(string newFile) { string connectionString = DbProviderHelper.GetExcelConn(newFile); var ds = new DataSet(); using (var conn = new OleDbConnection(connectionString)) { conn.Open(); OleDbDataAdapter dadp = new OleDbDataAdapter("SELECT * FROM [Hoja1$]", conn); dadp.TableMappings.Add("tbl", "Table"); dadp.Fill(ds); } return(ds); }
internal bool isTransaction = false; //是否为事务 /// <summary> /// Ctor /// <param name="connectString">数据库连接串或数据库名称</param> /// <param name="dbType">数据库类型</param> /// </summary> internal DbContext(string connectString, DatabaseType dbType = DatabaseType.MsSql) { this.dbProvider = DbProviderHelper.GetDbProvider(connectString, dbType); }