Error 1 ; System.Linq.Strings' is inaccessible due to its protection level C:\Users\WinBilling\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs 62 64 WindowsFormsApplication1
private void ButtonRestoreBackup_Click(object sender, EventArgs e) { try { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "Microsoft Access Database(2002-2003) (*.mdb)|*.mdb|Microsoft Access Database(2007-2009) (*.accdb)|*.accdb"; // If you want to keep default extensiion *.mdb then FilterIndex = 1 or if you want to keep default extension *.accdb then FilterIndex=2 dlg.FilterIndex = 1; if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TextBoxRestoreBackup.Text = dlg.FileName; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void ButtonRestoreDestination_Click(object sender, EventArgs e) { try { FolderBrowserDialog folder = new FolderBrowserDialog(); if (folder.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TextBoxRestoreDestination.Text = folder.SelectedPath; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void ButtonRestore_Click(object sender, EventArgs e) { try { DialogResult result = MessageBox.Show("Do you want to restore the Database?", "Do you?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); string fileName = null; //fileName = (TextBoxRestoreBackup.Text.ToString()); //.Substring(Strings.InStrRev(TextBoxRestoreBackup.Text, "\\")); fileName = TextBoxRestoreBackup.Text.Substring(Strings.InStrRev(TextBoxRestoreBackup.Text, "\\")); if (result == System.Windows.Forms.DialogResult.Yes) { if (System.IO.File.Exists(TextBoxRestoreDestination.Text + "\\" + fileName)) { DialogResult resultReplace = MessageBox.Show("This File is already exist. Do you want to replace the Database?", "Do you?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (resultReplace == System.Windows.Forms.DialogResult.Yes) { System.IO.File.Delete(TextBoxRestoreDestination.Text + "\\" + fileName); System.IO.File.Copy(TextBoxRestoreBackup.Text, TextBoxRestoreDestination.Text + "\\" + fileName); } } else { System.IO.File.Copy(TextBoxRestoreBackup.Text, TextBoxRestoreDestination.Text + "\\" + fileName); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)