i want to implement on settingswindow a clear database button , export database and import database so in case of lose the user can restore the backup

please provide the full complete adjusted fixed code 

settingswindow.xaml : 

<Window x:Class="DigihackApp.SettingsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Settings" Height="700" Width="900" 
        WindowStartupLocation="CenterScreen" 
        Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
        Loaded="Window_Loaded">
    <Window.Resources>
        <Style x:Key="LabelStyle" TargetType="Label">
            <Setter Property="FontWeight" Value="SemiBold"/>
            <Setter Property="Margin" Value="0,10,0,5"/>
        </Style>
        <Style x:Key="TextBoxStyle" TargetType="TextBox">
            <Setter Property="Padding" Value="5"/>
            <Setter Property="Margin" Value="0,0,0,10"/>
        </Style>
        <Style x:Key="ButtonStyle" TargetType="Button">
            <Setter Property="Padding" Value="15,5"/>
            <Setter Property="Margin" Value="0,0,10,0"/>
        </Style>
    </Window.Resources>

    <Grid Margin="30">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Header -->
        <StackPanel Grid.Row="0" Margin="0,0,0,20">
            <TextBlock Text="Settings" FontSize="28" FontWeight="Bold" Foreground="#2C3E50"/>
            <TextBlock Text="Configure your application preferences below." FontSize="14" Foreground="#7F8C8D"/>
        </StackPanel>

        <!-- Main Content Area -->
        <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
            <StackPanel Margin="0,0,0,20">
                <Expander Header="General Settings" IsExpanded="True" Margin="0,0,0,10">
                    <Grid Margin="20,10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"/>
                            <ColumnDefinition Width="1*"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0" Margin="0,0,10,0">
                            <Label Content="Main Title:" Style="{StaticResource LabelStyle}"/>
                            <TextBox x:Name="TitleTextBox" Style="{StaticResource TextBoxStyle}"/>
                            <Label Content="Address:" Style="{StaticResource LabelStyle}"/>
                            <TextBox x:Name="AddressTextBox" Style="{StaticResource TextBoxStyle}"/>
                            <Label Content="Postal Code:" Style="{StaticResource LabelStyle}"/>
                            <TextBox x:Name="PostalCodeTextBox" Style="{StaticResource TextBoxStyle}"/>
                        </StackPanel>
                        <StackPanel Grid.Column="1" Margin="10,0,0,0">
                            <Label Content="City:" Style="{StaticResource LabelStyle}"/>
                            <TextBox x:Name="CityTextBox" Style="{StaticResource TextBoxStyle}"/>
                            <Label Content="Country:" Style="{StaticResource LabelStyle}"/>
                            <!-- Changed ComboBox to TextBox -->
                            <TextBox x:Name="CountryTextBox" Style="{StaticResource TextBoxStyle}"/>
                            <Label Content="Phone Number:" Style="{StaticResource LabelStyle}"/>
                            <TextBox x:Name="PhoneNumberTextBox" Style="{StaticResource TextBoxStyle}"/>
                        </StackPanel>
                    </Grid>
                </Expander>

                <Expander Header="Store Logo" IsExpanded="True" Margin="0,10,0,0">
                    <StackPanel Margin="20,10">
                        <Button Content="Upload Logo" Click="_UploadLogo_Click" 
                                Style="{StaticResource ButtonStyle}" 
                                HorizontalAlignment="Left"/>
                        <Border Width="150" Height="150" 
                                BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" 
                                BorderThickness="1" Margin="0,10,0,0">
                            <Image x:Name="LogoPreview" Stretch="UniformToFill"/>
                        </Border>
                    </StackPanel>
                </Expander>
            </StackPanel>
        </ScrollViewer>

        <!-- Footer Buttons -->
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20,0,0">
            <Button Content="Save Settings" Click="SaveSettings_Click" Style="{StaticResource ButtonStyle}" 
                    Background="#27AE60" Foreground="White"/>
            <Button Content="Cancel" Click="Cancel_Click" Style="{StaticResource ButtonStyle}"/>
        </StackPanel>
    </Grid>
</Window>

settingswindows.xaml.cs

using System;
using System.Windows;
using System.Windows.Media.Imaging;
using Microsoft.Win32;

namespace DigihackApp
{
    public partial class SettingsWindow : Window
    {
        private string _logoPath;

        public SettingsWindow()
        {
            InitializeComponent();
            DatabaseHelper.InitializeDatabase();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            LoadSettings();
        }

        private void LoadSettings()
        {
            var settings = DatabaseHelper.LoadSettings();
            if (settings.HasValue)
            {
                TitleTextBox.Text = settings.Value.mainTitle;
                AddressTextBox.Text = settings.Value.address;
                PostalCodeTextBox.Text = settings.Value.postalCode;
                CityTextBox.Text = settings.Value.city;
                CountryTextBox.Text = settings.Value.country; // Updated
                PhoneNumberTextBox.Text = settings.Value.phoneNumber;
                _logoPath = settings.Value.logoPath;
                if (!string.IsNullOrEmpty(_logoPath) && System.IO.File.Exists(_logoPath))
                {
                    LogoPreview.Source = new BitmapImage(new Uri(_logoPath));
                }
                else
                {
                    LogoPreview.Source = null;
                }
            }
        }

        private void _UploadLogo_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = "Image files (*.png;*.jpeg;*.jpg)|*.png;*.jpeg;*.jpg|All files (*.*)|*.*"
            };

            if (openFileDialog.ShowDialog() == true)
            {
                _logoPath = openFileDialog.FileName;
                LogoPreview.Source = new BitmapImage(new Uri(_logoPath));
            }
        }

        private void SaveSettings_Click(object sender, RoutedEventArgs e)
        {
            DatabaseHelper.SaveSettings(
                TitleTextBox.Text,
                AddressTextBox.Text,
                PostalCodeTextBox.Text,
                CityTextBox.Text,
                CountryTextBox.Text, // Updated
                _logoPath,
                PhoneNumberTextBox.Text
            );
            MessageBox.Show("Settings saved successfully!", "Success", MessageBoxButton.OK, MessageBoxImage.Information);
        }

        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}