Connection Open & Connection Close, Dispose

Jerry Lipan 916 Reputation points
2021-11-28T23:45:17.44+00:00

Hi,

I saw this great article from one of the MVP

https://gavilan.blog/2019/05/10/asp-net-core-using-stored-procedures-with-ado-net/ .

I only saw the Connection Open. But no Connection Close & Dispose. It is in ASP.NET Core, we don't nee anymore the Connection Close & Dispose? We can assume that ASP.NET is intelligent enough

If we need to adding Connection Close & Dispose, please tell me at " where ? "

Need technical explanation

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,367 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,156 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 55,601 Reputation points
    2021-11-29T00:21:58.693+00:00

    Asp.net does not know about your connections and your code shoukd dispose. Just use a using statement, like the sample code.


0 additional answers

Sort by: Most helpful