Open Close db Connection: Best Practice
I am a Classic ASP developer and now learning ASP.net.
In Classic ASP, I developed a few functions that Connects, Executes Queries & Disconnect databases like for example:
//To Connection to db
set objConn = connectDB()
//Exceute Select Query
set rRecordSet = executeQuery("sql query here", objConn)
Is there any Expert .Net developer who can guide me on how to create similar functions in .Net so that I do not have to write same db connection code in each page of application.