ashish sadasing

ashish sadasing

  • NA
  • 22
  • 11.4k

Closing database connection in asp.net C# razor syntax

Apr 7 2016 8:38 AM
Hello Everyone,
 
I have built a website in asp.net C# webpages with razor syntax. I have used WebMatrix. My database is IBM db2.
 
I have two questions.
 
The first question is : 
 
I have opened a database connection where "client" is my connection string and is stored in my web.config file.
var db = Database.Open(client); 
I would like to know how to close this database connection. 
----------------------------- 
 
The second question is :
 
The website extension is .cshtml
What are the requirements for the .cshtml extension that i need in my webserver in order to deploy it ?
For instance, i have these installed :

IIS 7.0
.Net Framework 4.0
I would be grateful if you could help me with some answers. Thanks in advance.
 

Answers (5)