asp.net - I am unable to connect to a database. I have an error "Underlying provider failed to open" -


i unable connect database. have error "underlying provider failed on open". connection string

<connectionstrings> <add name="elementcontext"      connectionstring ="server=.; database=element; integrated security = sspi"      providername="system.data.sqlclient"/> </connectionstrings> 

the controller

using system; using system.collections.generic; using system.linq; using system.web; using system.web.mvc; using model_class_implementation.models;  namespace model_class_implementation.controllers {     public class elementcontroller : controller     {         public actionresult element_details()         {             elementcontext elementcontext = new elementcontext();             element element = elementcontext.elements.single(elem => elem.element_id == 1);             return view(element);         }     } } 

the class contains dbcontext is

using system; using system.collections.generic; using system.linq; using system.web; using system.data.entity;  namespace model_class_implementation.models {     public class elementcontext : dbcontext     {         public dbset<element> elements { get; set; }     } } 

any appreciated.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -