I am working on an ASP.NET application and am trying to add user authentication. As a first step, I am using the Web Site Administration tool (Website | ASP.NET Configuration) to manage users and permissions.
Accessing this website is incredibly slow. To load the main page takes 30 seconds. When navigating to the Security page (also 30 seconds), I am presented with this error:
I have authentication mode set to "Forms" in the web.config file.
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: Unable to connect to SQL Server database.
It asks me to run "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe", which also gives me an error message.
How do I fix these problems with speed and enabling security/users?
The issue that you are getting is due to an invalid SQL Server connection, you can setup the SQL Server connection in the web.config, once it is able to actually connect to the database, it will perform in the proper manner.
EDIT below is the code needed in web.config to setup the new connection
<connectionStrings>
<clear />
<add name="LocalSqlServer" connectionString="server=yourservername;database=somedatabasename;etc..." />
</connectionStrings>
Related
I am developing a website with the Asp.net MVC5 template. This website have obviously a database with some informations. This MS-Sql database runs on a remote VM. While coding I tested this site with the integrated IIS Express and the mentioned database.
Now I wanted to publish this website on a real IIS 10.0 Server, this IIS Server runs on the same VM as the database.
I published the website as follow:
Right click on project in VS15 > Publish > File System (Publish Method) > Copied the compiled data to the mentioned VM > In the IIS Manager I created a new website based on the compiled source data.
Now the problem:
When I try to run this website (localhost or via remote from my client) the following error occurs:
Login failed for user 'DOMAIN\MACHINENAME$'.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'DOMAIN\MACHINENAME$'.
This two connectionstrings are in my web.config, both are autogenerated from Asp.Net Frameork:
<connectionStrings>
<add name="InfoScreenContext" connectionString="data source=vsdev1972\;initial catalog=InfoScreen;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="UserProfile" connectionString="data source=vsdev1972\;initial catalog=InfoScreen;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>
I was searching a whole day for a solution but none of these approaches worked for me:
Adding this DOMAIN\MACHINENAME$ user to the database users
Enabled Windows Authentication in IIS Manager
Tried to edit the connection string
Granted source access for everyone
Any ideas? If u need any further informations pls contact me!
So I'm in the process of making the configurations for my site on Plesk Web Host Edition but unfortunately I have an issue of accessing the database through my website.
I have noted the following:
1. I can access the Database through SQL Server Management Studio (SSMS) without any issues but one important thing to mention is that when I try to make my DB user as the owner of the database I get the following error:
Cannot alter the role 'db_owner', because it does not exist or you do not have permission. In other words, I'm not the owner of the database and I can't alter anything in it! although that I have created the database and the DB user through Plesk Panel.
2. I configured the web.config as follows:
<add name="xxxConnectionString" connectionString="data source=127.0.0.1\SQLEXPRESS;server=127.0.0.1;database=xxxx.mdf;Uid=xxx;pwd=xxxx" />
3. When accessing the website I get the following error:
Cannot open database "xxx.mdf" requested by the login. The login failed.
Login failed for user 'xxx'
I contacted the support of the hosting provider but it's been almost 4 days now without any reply. I'm really hoping of finding the answer with you guys.
Thanks in advance
I was able to find a solution for the ConnectionString issue. Below is the connection that I used to fix the issue:
<add name="CarRentalConnectionString" connectionString="Data Source=localhost;Initial Catalog=DATABASENAME;Integrated Security=false;User ID=USERNAME;Password=PASSWORD" />
I've Developed an asp.net website which require users to login using the default asp.net login control and local SQl.
unfortunately we had to reload the PC with a fresh copy of Win7 Now, I got the IIS7 back up and user can navigate to the login.aspx page, but trying to log in I get the following error. "User does not have permission to perform action" -now I have recreated all the user under the asp.net Configuration under Visual Studio 2012 and still nothing. Any advice where to start solving it?
Did you create user on your SQL ? create a new login.And change your connectionstring.
forexample create a user in sql
and add this connection string to your web config inside
<connectionStrings> <add name="xxxConnectionstr" connectionString="Data Source=.\;Initial Catalog=yourdatabasename"; Uid="yoursqluser"; Pwd="yourpassword" providerName="System.Data.SqlClient"/></connectionStrings>
I think your connection string contains "Integrated Security=True" and this means u are logging in with windows user.And when you change windows 7,user changed
I have a strange problem setting up my webapplications. I have a clean webserver machine where I have two web applications. One is a asp.net application while the other is a silverlight application. Both should use the same database hosted on an external db server.
My problem is that while my asp.net application is working as it should my silerlight application is not even loaded. Loads for about a minute (No silverlight loading indicator) before I get the Internet Explorer cannot display the webpage with following information:
•Internet connectivity has been lost.
•The website is temporarily unavailable.
•The Domain Name Server (DNS) is not reachable.
•The Domain Name Server (DNS) does not have a listing for the website's domain.
•There might be a typing error in the address.
•If this is an HTTPS (secure) address, click Tools, click Internet Options, click Advanced, and check to be sure the SSL and TLS protocols are enabled under the security section.
If I change my connectionstring in web.config for the silverlight application to connect to the test db server (also external) it works fine.
This tells me that the applications should be configured correctly?
connectionstring : <add name="myConn" connectionString="Data Source=prod_server;Initial Catalog=mydb;Persist Security Info=True;User ID=myusername;Password=mysecretpassword" providerName="System.Data.SqlClient"/>
They are running in the same application pool. I have also tried setting them up in separate applicationpools with no luck.
Fiddler reports an 504 error, but why does my web application work? This IIS 7.5
Hope someone can help
Solved it. Was a db update that timed out. Some developers should learn to use logging!
I am using SQL Server Web (Full version not SQLExpress). I can connect to the database fine from my VS2010. However when I go to ASP.NET Web Application Administration, click "Security" I got below error:
There is a problem with your selected
data store. This can be caused by an
invalid server name or credentials, or
by insufficient permission. It can
also be caused by the role manager
feature not being enabled. Click the
button below to be redirected to a
page where you can choose a new data
store.
The following message may help in diagnosing the problem: Unable to connect to SQL Server database. "
I know I miss something. Can somebody help?
Thanks
Just a tip, have a look in your web.config file and set YOURMACHINENAME in the data source
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Integrated Security=SSPI;Data Source=YOURMACHINENAME ;Initial Catalog=aspnetdb;" providerName="System.Data.SqlClient" />
</connectionStrings>
Hope it help