Hi I just want to know why is this happening and how can I stop it from happening?
This is how it looks before i click the export data
Then it minimizes the form somehow?
This is a windows form with a user control in the middle. The windows form is set to
this.WindowState = System.Windows.Forms.FormWindowState.Maximized
This is my code for the SaveFileDialog
private void btnExport_Click(object sender, EventArgs e)
{
Microsoft.Win32.SaveFileDialog ofd1 = new Microsoft.Win32.SaveFileDialog();
ofd1.Filter = "Database Files (*.sqlite)|*.db";
ofd1.FileName = "dbwaterworks.sqlite";
// customize file dialog properties here
if (ofd1.ShowDialog() == true)
{
var path = Path.GetFullPath(ofd1.FileName);
var destinationCnx = "Data Source=" + path + "; Version=3;";
using (var source = new SQLiteConnection("Data Source=dbwaterworks.sqlite; Version=3;"))
using (var destination = new SQLiteConnection(destinationCnx))
{
source.Open();
destination.Open();
source.BackupDatabase(destination, "main", "main", -1, null, 0);
}
}
else
{
MessageBox.Show("Canceled");
}
}