GeekyNuns GeekyNuns - 4 months ago 13
SQL Question

Cannot connect to database mvc

I cant connect to database, working on new pc.
Here are params with which i access my sql database :
sql

My connection string in Web.config is :

<connectionStrings>
<add name="DefaultConnection" connectionString="data source=DMITRIJSS-PC\SQLEXPRESS;initial catalog=HRM_MVC_DEV_Test;user id=BTG\DmitrijsS;password=;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
<add name="HRMEntities" connectionString="metadata=res://*/HRMModel.csdl|res://*/HRMModel.ssdl|res://*/HRMModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DMITRIJSS-PC\SQLEXPRESS;initial catalog=HRM_MVC_DEV_Test;user id=BTG\DmitrijsS;password=;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />



When I am trying to access db it throws window where I have to write password, when I leave it blank -
Login failed for user BTG\DmitrijsS

Answer
<add name="DefaultConnection" connectionString="data source=DMITRIJSS-PC\SQLEXPRESS;initial catalog=HRM_MVC_DEV_Test;Integrated Security=true;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
<add name="HRMEntities" connectionString="metadata=res://*/HRMModel.csdl|res://*/HRMModel.ssdl|res://*/HRMModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DMITRIJSS-PC\SQLEXPRESS;initial catalog=HRM_MVC_DEV_Test;Integrated Security=true;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
Comments