I've built a code first project in Visual Studio. When I run it the dbConext "HistoryContext" appears under the DataConnections tab in the Server Explorer in VS. But there is a little red x and when I try to click on HistoryContext I get the error message:
Cannot open database "History1" requested by the login. The login failed. Login failed for user 'LAPTOP\Jerome'.
I went to Microsoft SQL Server Management Studio and connected to the localDb. I then went to security settings and both SQL and Windows authentication were ticked. But when I tried to just make it Windows authentication I got the error message:
TITLE: Microsoft SQL Server Management Studio
Alter failed for Server '(localdb)\MSSQLLocalDB'. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.0.16100.1+((SSMS_Rel_16_5).161130-1812)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Alter+Server&LinkId=20476
ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
RegCreateKeyEx() returned error 5, 'Access is denied.' (Microsoft SQL Server, Error: 22002) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.1601&EvtSrc=MSSQLServer&EvtID=22002&LinkId=20476
BUTTONS: OK
Any advice about how to authenticate my credentials would be great.
Thanks,
Jerome