You are on page 1of 2

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Data.OleDb;
namespace finalgame1
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
OleDbConnection connection = new OleDbConnection();
connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Da
ta Source=..\..\images\highscore.accdb;
Persist Security Info=False;";
connection.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connection;
command.CommandText = "Select highscore from score";
OleDbDataReader reader = command.ExecuteReader();
while(reader.Read()){
showscore.Items.Add(reader["highscore"].ToString());
}
connection.Close();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
MainWindow main = new MainWindow();
main.Show();
this.Close();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
MessageBoxResult result= MessageBox.Show("do you want to exit?","E
xit Game",MessageBoxButton.YesNo,MessageBoxImage.Question);

if (result == MessageBoxResult.Yes)
{
this.Close();
}
}
private void Window_Closing(object sender, System.ComponentModel.CancelE
ventArgs e)
{

}
private void discription_Click(object sender, RoutedEventArgs e)
{
}
}
}

You might also like