private void BQueryClick(object sender, EventArgs e) { // check if it's a valid SpatiaLite layer using (OpenFileDialog fd = new OpenFileDialog { Title = Resources.OpenSpatialiteDatabase, Filter = Resources.SpatialiteDatabaseFilter }) { if (fd.ShowDialog() == DialogResult.OK) { string cs = SqLiteHelper.GetSqLiteConnectionString(fd.FileName); string error; var slh = SpatiaLiteHelper.Open(cs, out error); if (slh == null) { MessageBox.Show(string.Format(Resources.DatabaseNotValid, fd.FileName, error)); return; } using (var frm = new FrmQuery(slh, App.Map)) { frm.ShowDialog(); } } } }
private void BQueryClick(object sender, EventArgs e) { // check if it's a valid SpatiaLite layer using (OpenFileDialog fd = new OpenFileDialog { Title = Resources.OpenSpatialiteDatabase, Filter = Resources.SpatialiteDatabaseFilter }) { if (fd.ShowDialog() == DialogResult.OK) { string cs = SqLiteHelper.GetSqLiteConnectionString(fd.FileName); var frm = new FrmQuery(cs, App.Map); frm.Show(); } } }