コード例 #1
0
        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();
                    }
                }
            }
        }
コード例 #2
0
 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();
         }
     }
 }