コード例 #1
0
        public static DataSet ExecuteDatasetTEST(string strConnection, string commandText)
        {
            if (strConnection == null) throw new ArgumentNullException("connection");

            // Create a command and prepare it for execution
            DbConnection conn = new TAdoDbxInterBaseConnection();
            conn.ConnectionString = strConnection;

            DataSet dsReturnin = new DataSet();
            DataTable dt = new DataTable();
            string sql = commandText;
          

                DbCommand cmd = conn.CreateCommand();
                cmd.CommandText = sql;
                conn.Open();

                DbDataReader myreader = cmd.ExecuteReader();
                dsReturnin.Tables.Add(dt);
                dsReturnin.Load(myreader, LoadOption.PreserveChanges, dsReturnin.Tables[0]);
                myreader.Close();
                conn.Close();
                conn.Dispose();
         

            return dsReturnin;
        }
コード例 #2
0
        public static DataSet ExecuteDataset_UPDT_COMMD(string strConnection, string commandText)
        {
            if (strConnection == null) throw new ArgumentNullException("connection");

            // Create a command and prepare it for execution
            DbConnection conn = new TAdoDbxInterBaseConnection();
            conn.ConnectionString = strConnection;

            DataSet dsReturnin = new DataSet();
            DataTable dt = new DataTable();
            string sql = commandText;
          

                DbCommand cmd = conn.CreateCommand();
                cmd.CommandText = sql;
                conn.Open();


                DbDataAdapter adapter = new TAdoDbxDataAdapter();
                
                adapter.UpdateCommand = cmd;


                //BdpCommand CommIns = new BdpCommand("INSERT INTO TESTTABLE VALUES(?)", Conn);
                //BdpDataAdapter adapter
                //adapter.InsertCommand = CommIns; 
         

            return dsReturnin;
        }