Exemplo n.º 1
0
        /// <summary>
        /// This function loads the compiled file from Database Loader Editor.
        /// </summary>
        /// <param name="connectionString">Connection string of the database to load the data into.</param>
        /// <param name="filePath">Full path of the ".dataload" file to be loaded in the database.</param>
        /// <param name="isPermanent">Whether to leave the data in the database after the process is finished running. True to not make the data stay in the database, false to automatically unload it when process terminates.</param>
        public void Load(string connectionString, string filePath, bool isPermanent)
        {
            var fileContent = File.ReadAllText(filePath);

            executeQuery(connectionString, _dataloadReader.GetInsertQuery(fileContent));

            if (!isPermanent)
            {
                startUnloadProcess(connectionString, filePath);
            }
        }
        private void bulkLoadPermanent(string connectionString, string filePath)
        {
            var fileContent = File.ReadAllText(filePath);

            executeQuery(connectionString, _dataloadReader.GetInsertQuery(fileContent), executeDeleteOrInsertQueryDeferConstraints);
        }