void Open_Command(object sender, ExecutedRoutedEventArgs e)
 {
     table = new DataTable();
     frmCreateConnection winConnection = new frmCreateConnection(table);
     winConnection.ShowDialog();
     mainDataGrid.ItemsSource = table.DefaultView;
     txtBDName.Text = BDName;
     txtTableName.Text = TableName;
 }
 public MainWindow()
 {
     InitializeComponent();
     CommandBinding binding = new CommandBinding(ApplicationCommands.Open);
     binding.Executed += new ExecutedRoutedEventHandler(Open_Command);
     this.CommandBindings.Add(binding);
     table = new DataTable();
     frmCreateConnection winConnection = new frmCreateConnection(table);
     winConnection.ShowDialog();
     mainDataGrid.ItemsSource = table.DefaultView;
     txtBDName.Text = BDName;
     txtTableName.Text = TableName;
 }