returns two values

advertisements

How can I modify this:

if ( reader.GetString( reader.GetOrdinal( "Status" ) ) == "Yes" )
{
    return true; // Return Status + Date it was Completed
}
else
{
    return false; // Return Status + null Date.
}

To return two values? Currently it returns the column 'Status' from the database with the value of Yes or No. How can I have it return the completed date and the status?


    private void DoSomething() {
        string input = "test";
        string secondValue = "oldSecondValue";
        string thirdValue = "another old value";
        string value = Get2Values(input, out secondValue, out thirdValue);
        //Now value is equal to the input and secondValue is "Hello World"
        //The thirdValue is "Hello universe"
    }

    public string Get2Values(string input, out string secondValue, out string thirdValue) {
        //The out-parameters must be set befor the method is left
        secondValue = "Hello World";
        thirdValue = "Hello universe";
        return input;
    }