Yes, You can do it. Simple define connection string in web.config file and then Access using
ConfigurationManger
.
<connectionstrings>
<add name="DevelopmentConnectionString">
connectionString="Data Source=sandeepss-PC;Initial Catalog=Development;User ID=sa;
Password=*******" providerName="System.Data.SqlClient" />
Now string pass in your
SqlConnection
after that all is same as you do in asp.NET with ADO.NET object.
If your are working with Linq in MVC application then it can be helpful.
http://www.codeproject.com/Articles/720471/A-Simple-MVC-Application-using-LINQ-to-SQL