Beispiel #1
0
        public static DataTable GetDataTable(String query,IDbEnvironment environment)
        {
            DbCommand dc = environment.CreateCommand(query, CommandType.Text);
            if (Options.ShouldBindSymbols())
                environment.BindFixtureSymbols(dc);

            DbDataAdapter oap = environment.DbProviderFactory.CreateDataAdapter();
            oap.SelectCommand = dc;
            var ds = new DataSet();
            oap.Fill(ds);
            dc.Dispose();
            return ds.Tables[0];
        }
Beispiel #2
0
        public static DataTable GetDataTable(String query, IDbEnvironment environment, int rsNo)
        {
            DbCommand dc = environment.CreateCommand(query, CommandType.Text);

            if (Options.ShouldBindSymbols())
            {
                environment.BindFixtureSymbols(dc);
            }

            DbDataAdapter oap = environment.DbProviderFactory.CreateDataAdapter();

            oap.SelectCommand = dc;
            var ds = new DataSet();

            oap.Fill(ds);
            dc.Dispose();
            return(ds.Tables[rsNo - 1]);
        }
Beispiel #3
0
        private void InspectQuery(Parse table)
        {
            DbCommand dc = (DbCommand)environment.CreateCommand(objectName, CommandType.Text);

            environment.BindFixtureSymbols(Symbols, dc);

            DbDataAdapter oap = environment.DbProviderFactory.CreateDataAdapter();

            oap.SelectCommand = dc;
            DataSet ds = new DataSet();

            oap.Fill(ds);
            dc.Dispose();
            DataTable dtbl = ds.Tables[0];

            Parse newRow = getHeaderFromRS(dtbl);

            table.Parts.More = newRow;
            foreach (DataRow dr in dtbl.Rows)
            {
                newRow.More = getDataRow(dr);
                newRow      = newRow.More;
            }
        }