Hi kripisaxena,
Whatever conopen() method you have pasted is not an universal approach, the approach to open and close a connection is varies from programmer to programmer, architecture to architecture.
However Concering .Net languages, the connection.Open and Connection.Close are the two method, where connection is an object of SqlConnection class.
After setting relavent properties you need to establish a connection between your application and Database server. Connection is a resource so it should open as less duration as its indeed required to open therefore, after finishing connections task firing queries, we should imediately close the connection. For that we are using SqlConnecion.Close method.
Thanks and Regards,
Rk_Hirpara