Пример #1
0
        protected async Task <DataTable> ExecuteScriptFile(
            string connectionString,
            string scriptFile)
        {
            using (var connection = await DatabaseDriver.OpenConnection(connectionString))
                using (var command = connection.CreateCommand())
                {
                    command.CommandType = CommandType.Text;
                    command.CommandText = await GetResourceText(GetType().Assembly, scriptFile);

                    using (var reader = await command.ExecuteReaderAsync())
                    {
                        var dataTable = new DataTable();
                        dataTable.Load(reader);

                        return(dataTable);
                    }
                }
        }