MySql.Data.MySqlClient.MySqlConnection.Ping C# (CSharp) Method

Ping() public method

Ping
public Ping ( ) : bool
return bool
        public bool Ping()
        {
            if(Reader != null)
                throw new MySqlException(Resources.DataReaderOpen);
            if (driver != null && driver.Ping())
                return true;
            driver = null;
            SetState(ConnectionState.Closed, true);
            return false;
        }

Usage Example

        }//End public bool seEjecutoComando()

        public bool Conectar()
        {

            MySqlConnection mConnection = new MySqlConnection(MyConString);

            try
            {
                mConnection.Open();
            }
            catch (Exception ex)
            {
                return false;
            }

            if (mConnection.Ping())
            {

                //Command = Connection.CreateCommand();
                return true;

            }//End if (Connection.Ping())

            return false;

        }//End public void Conectar()
All Usage Examples Of MySql.Data.MySqlClient.MySqlConnection::Ping