Close() public method

Closes the underlying connection
public Close ( ) : void
return void
        public override int Execute()
        {
            CommandStatus retCode;
            FdoConnection conn = null;
            try
            {
                conn = new FdoConnection(_provider, _connStr);
                conn.Open();
            }
            catch (OSGeo.FDO.Common.Exception ex)
            {
                WriteException(ex);
                retCode = CommandStatus.E_FAIL_CONNECT;
                return (int)retCode;
            }

            using (conn)
            {
                using (FdoFeatureService service = conn.CreateFeatureService())
                {
                    try
                    {
                        service.CreateDataStore(_dstoreStr);
                        WriteLine("Data Store Created!");
                        retCode = CommandStatus.E_OK;
                    }
                    catch (OSGeo.FDO.Common.Exception ex)
                    {
                        WriteException(ex);
                        retCode = CommandStatus.E_FAIL_CREATE_DATASTORE;
                        return (int)retCode;
                    }
                }
                if (conn.State != FdoConnectionState.Closed)
                    conn.Close();
            }
            return (int)retCode;
        }
 public void TestConnection()
 {
     FdoConnection conn = new FdoConnection("OSGeo.ODBC", string.Format("ConnectionString=\"{0}\"", _view.BuilderObject.ToConnectionString()));
     try
     {
         FdoConnectionState state = conn.Open();
         if (state == FdoConnectionState.Open)
         {
             _view.ShowMessage(null, "Test successful");
             conn.Close();
         }
         else
         {
             _view.ShowError("Connection test failed");
         }
     }
     catch (FdoException ex)
     {
         _view.ShowError(ex.InnerException.Message);
     }
 }
 internal bool Test()
 {
     using (var conn = new FdoConnection(_view.Provider, GetBaseConnectionString()))
     {
         if (conn.Open() != FdoConnectionState.Closed)
         {
             conn.Close();
             return true;
         }
     }
     return false;
 }
        public void TestConnection()
        {
            FdoProviderInfo provider = _view.SelectedProvider;
            string connStr = ExpressUtility.ConvertFromNameValueCollection(_view.ConnectProperties);

            FdoConnection conn = new FdoConnection(provider.Name, connStr);
            try
            {
                FdoConnectionState state = conn.Open();
                if (state == FdoConnectionState.Open || state == FdoConnectionState.Pending)
                {
                    _view.ShowMessage(null, "Test successful");
                    conn.Close();
                }
                else
                {
                    _view.ShowError("Connection test failed");
                }
            }
            catch (FdoException ex)
            {
                _view.ShowError(ex.InnerException.Message);
            }
            finally
            {
                conn.Dispose();
            }
        }
        public bool Create()
        {
            bool ok = true;
            FdoConnection conn = new FdoConnection(_view.Provider, GetBaseConnectionString());
            bool created = false;
            bool cleanup = true;
            try
            {
                using (var svc = conn.CreateFeatureService())
                {
                    try
                    {
                        CreateDataStore(svc);
                        created = true;
                    }
                    catch (Exception ex)
                    {
                        _view.ShowError(ex);
                        created = false;
                        ok = false;
                    }
                }

                if (created)
                {
                    //Amend the connection string to include the data store
                    var builder = new DbConnectionStringBuilder();
                    builder.ConnectionString = conn.ConnectionString;
                    builder[_view.DataStoreParameter] = _view.DataStoreName;
                    conn.ConnectionString = builder.ConnectionString;
                    conn.Open();

                    using (var svc = conn.CreateFeatureService())
                    {
                        CreateDefaultSpatialContext(svc);
                    }
                }
            }
            finally
            {
                if (created)
                {
                    if (File.Exists(_view.SchemaFile))
                    {
                        ApplySchemas(conn);
                    }

                    if (_view.ConnectOnCreate)
                    {
                        _connMgr.AddConnection(_view.ConnectionName, conn);
                        cleanup = false;
                    }
                }

                if (cleanup)
                {
                    conn.Close();
                    conn.Dispose();
                }
            }

            return ok;
        }