What is difference between this two C# methods

Posted by RICH KID SMART KID on Stack Overflow See other posts from Stack Overflow or by RICH KID SMART KID
Published on 2010-05-20T09:04:31Z Indexed on 2010/05/20 9:10 UTC
Read the original article Hit count: 256

Filed under:
|
|

What is the difference between these two cases. Firstly, if I open the connection and pass it into my method as a parameter, compared to opening the connection directly in the method?

cnn.open()
func(cnn,param1,param2);

vs

func(cnn, param1,param2)
{
  cnn.open();
  //open connection here
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about mysql