"Factory" which produces a "connection" object I am a newbie in C# and in OOP in general. I decided to create a class that should give out a "connection" object. I would like your advice and critique on improving it.

public class Connection_Factory
{

  private string Last_Connection_Trying   = "";
  private string Last_Connection_Success = "";
  public OracleConnection Build(string connection_string)
  {
    Last_Connection_Trying = connection_string;
    return new OracleConnection(connection_string);
  }

  public OracleConnection Build()
  {
    return Build(Last_Connection_Success);
  }

  public void Mark_Connection_as_Successful(string connection_string)
  {
    Last_Connection_Success = connection_string;
  }

  public void Mark_Connection_as_Successful()
  {
    Last_Connection_Success = Last_Connection_Trying;
  }

}
Firstly your code lacks any comments saying what it does and why.  When I first looked at your post I assumed it was a TCP socket class and was looking for the port number.  Also the layout could be improved, regular blank lines, etc.

I would do this:

public void Mark_Connection_as_Successful()
{
    Mark_Connection_as_Successful(Last_Connection_Trying);
}


just like you have with Build.  At the moment they are trivial functions, but that might not always be the case.

Would it be appropriate to verify the format of the connection string, or is this done in the OracleConnection constructor?