Esempio n. 1
0
        void PostGISDataset_ConnectionStringChanged(gView.Framework.OGC.DB.OgcSpatialDataset sender, string provider)
        {
            try
            {
                _connectionString = DbConnectionString.ParseNpgsqlConnectionString(_connectionString);
                _factory          = Npgsql.NpgsqlFactory.Instance;

                #region Version

                try
                {
                    object obj = base.ExecuteFunction("select postgis_version()");
                    if (obj is string)
                    {
                        string version = obj.ToString();
                        if (!int.TryParse(version.Split('.')[0], out _majorVersion))
                        {
                            _majorVersion = 1;
                        }
                    }
                }
                catch
                {
                    _majorVersion = 1;
                }

                #endregion
            }
            catch
            {
                _factory = null;
            }
        }
Esempio n. 2
0
        async public override Task <bool> SetConnectionString(string value)
        {
            var ret = await base.SetConnectionString(value);

            _connectionString = DbConnectionString.ParseNpgsqlConnectionString(_connectionString);

            return(ret);
        }