Пример #1
0
        /// <summary>
        /// Create an SDS object in memory
        /// </summary>
        /// <param name="shared">Boolean indicating whether a shared dataset is required</param>
        /// <returns>The new dataset object</returns>
        public DataSet CreateSDSInMemory(bool shared)
        {
            // Create and SDS object
            DataSet internalSDS;

            // If a shared dataset has been specified, then open a shared dataset object, otherwise open an ordinary dataset object
#if true
            internalSDS = DataSet.Open("msds:memory");
#else
            if (shared)
            {
                internalSDS = SharedDataSet.Open("msds:memory2");
            }
            else
            {
                internalSDS = DataSet.Open("msds:memory2");
            }
#endif

            // Disable auto commit
            internalSDS.IsAutocommitEnabled = false;

            // Return the SDS object
            return(internalSDS);
        }