Пример #1
0
        public DataTable ExecuteDataTable(DbCommand cmd)
        {
            DbProviderFactory dbfactory     = DbProviderFactories.GetFactory(DbHelper.GetProvider());
            DbDataAdapter     dbDataAdapter = dbfactory.CreateDataAdapter();

            dbDataAdapter.SelectCommand = cmd;
            DataTable dataTable = new DataTable();

            dbDataAdapter.Fill(dataTable);
            return(dataTable);
        }
Пример #2
0
        public DataTable ExecuteDataTable(DbCommand cmd, Trans t)
        {
            cmd.Connection  = t.DbConnection;
            cmd.Transaction = t.DbTrans;
            DbProviderFactory dbfactory     = DbProviderFactories.GetFactory(DbHelper.GetProvider());
            DbDataAdapter     dbDataAdapter = dbfactory.CreateDataAdapter();

            dbDataAdapter.SelectCommand = cmd;
            DataTable dataTable = new DataTable();

            dbDataAdapter.Fill(dataTable); return(dataTable);
        }