SQL Server permission error after publishing website from visual studio 2015 - sql-server

Having all sorts of problems after publishing website from VS2015.
My Site has been working fine when run from within VS2015. However, I followed some instructions to Publish the website to my IIS and now the site Login page comes up but after entering user/password the application fails to make connection to the database and shows the error:
Failed to generate a user instance of SQL Server due to a failure in impersonating the client. The connection will be closed.
I am running Windows 8.1, SQL Server 2008/R2, Visual Studio 2015 and the Database connect string is:
I do NOT currently have Database User I am simply connecting using Windows Integrated authentication.
I think it's some kind of permissions error, can someone please assist ?

The website is using the AppPool identity to connect to the SQL database. By default the AppPool uses a Built-in Account.
You can change the AppPool to use a custom domain account which as rights to the database.

Related

Cannot deploy metadata to Analysis Services

Building a tabular model in Visual Studio I'm facing an issue when trying to deploy the model to the Analysis Service Server (SQL Server 2019 Standard). I get this error:
Cannot deploy metadata. Reason: An error occurred while connecting to the server.
I already set the deployment server in the model properties. And the last thing I tried was to set the Administrator local user of the SQL Server in the Impersonation Information dialog, but is giving me the invalid user / password error.
Also tried to use Service Account, but having the same error.
I can get the data from the SQL Server (using SQL Server Authentication) but the problem is when trying to deploy the model to the Analysis Server.
Is this error caused because the servers are not part of an AD?
Any way to work around this, or way to see any logs?
Using Visual Studio 2017 and 2019.
Thanks.
Is this error caused because the servers are not part of an AD?
Possibly. SSAS only supports Windows Integrated Auth, so you need to make that work. The preferred method is to deploy from a session owned by a SSAS administrator, from a workstation in the same domain.
If that's not possible there are a couple of other options. One is to create a local account on both the workstation and the server with the same name and password, and log in as that account to deploy.
The other is to install a Windows Credential in the windows credential store for an identity that has rights to deploy to the SSAS database. Or to run visual studio via runas /netonly specifying the credentials for the remote server.

Login failed for user 'IIS APPPOOL\

I'm using SQL Server 2014 in my local system. There is an MVC application with .NET Framework 4.6.1 and it worked fine.
Now, I've created a new MVC application with .NET Framework 4.7.2 and see this issue. The local website is unable to connect to the Database.
System.Data.SqlClient.SqlException Cannot open database "NewApp"
requested by the login. The login failed. Login failed for user 'IIS
APPPOOL\dev.newapp.com'.
I have checked the User Mapping properties and both applications are listed. I did not make any changes in IIS or the SQL Server.
Also, I tried changing the Identity in IIS for DefaultAppPool to LocalSystem with no luck.
The IIS, SQL server & the website - all are in the same machine.
There a difference between Windows and SQL Server Authentication.
Per your images you have configured sa user which is SQL Server Authentication and you cannot use Windows Authentication in your application and web.config.
So, if you want to use sa login then update your web.config file and database connection string to be like:
Server=yourServer;Database=yourDatabaseName;User=sa;Password=saPassword;
or different syntax:
Data Source=yourServer;Initial Catalog=yourDatabaseName;User=sa;Password=saPassword;
Your application is trying to use local user as Windows authentication.

SQL Server 2012 Express login failed from client machine

I have installed SQL Server 2012 Express edition on a pc which is on a workgroup running Windows 10. I have also created an user for access to the database through the VS2013 application.
When trying to connect to the server from the client machine, I am getting a message saying login failed and it is from an untrusted domain. The client is also on the same workgroup. However, after the SQL Express was installed on the "server" machine, the name of that pc was changed. I can connect to the database from the server using SSMS using the new computer name (in the instance). I have set remote connection parameters and also configured firewall rules. Yet I am unable to access the server from the client machine.
I also want to ensure that the database is totally secured against access or intrusion. Anyone having access to the server machine can view/edit the database using Windows Authentication. How best to safeguard against it?
Any tips would be appreciated.
CL
try to make a new user in server machin using SSMS and be sure that you are adding the new user to the Login Part of Security in SSMS . For this you need to Login to SSMS as administrator ...

Connection To The Database Failed on install dotnetnuke

I try to install dotnetnuke 7. I created an user that access to dnn database and in properties of sql server set the server authentication to sqlserver and windows authentication .But when browse website show this message :Connection To The Database Failed
Try connecting to the database using SQL Server Management Studio using the same credentials that you specify in DNN. That might help you identify what you are doing wrong.
You'll want to verify that the SQL Server accepts connections from the web server, assuming that they are not on the same machine.

Login error to database for Team Foundation Server 2010

I have installed Team Foundation Server 2010 (basic configuration) on a Windows Server 2003 without any problems. But when I go to administer the Team Foundation Server Administration Console, I get the error when in the press "Administer Security" or "Group Membership"
Server was Unable to process request. ---> Team Foundation services are not available from the server. Technical information (for administrator): The request colud note asking Processed Because the application is configured correctly note. No host service is available for the request.
If I try to go to http://localhost:8080/tfs, an I Get Runtime Error
In the Event Viewer I get following errors each time I try to do anything
Failue Aud - MSSQL$SQLEXPRESS - Login failed for user 'SAG-S01\ASPNET'. Reason: Failed to open the explicitly specified database. [CLIENT: ]
Error - TFS Services - Exception Message: TF246017: Team Foundation Server could not connect to the database. Verify that the server that is hosting the database is operational, and that network problems are not blocking communication with the server. (type DatabaseConnectionException)
You could start investigating by starting the SQL Server Management Studio and navigate to the SQLExpress instance on your data tier. See if the Tfs databases are running and whether the ASPNET user has access rights for the database.
Now I found where the problem was. It was set in the IIS server that TFS would run with .NET 1.1 instead of 4.0
It's weird. Can you check that you can access the database via Sql Server Management Studio.
If you can access with local system account or sa user; you have to deep dive form TFS - SQL Server connections. May be your user doesn't grant to connect SQL. Please try first, connect via Management Studio.

Resources