Search code examples
asp.netsql-serverdatabaseplesk

Setting up ASP.NET in Plesk Web Host Edition


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


Solution

  • 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" />