DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

SQL Server connection string

Sort:
You are not authorized to post a reply.





New Around Here





    Hello,

    I'm totally new to DNN. I've downloaded DNN 9.4 on the local machine. InstallWizard cannot seem to connect to SQL Server 14 Developer edition on local machine. Wondering if someone can tell me what should be my connection string in web.config file. I have already created dnntest database in the SQL server and add IIS Apppool\dnn user as a db owner.

    Joe






    Advanced Member





      Assuming you've installed SQL Server with the default settings, it should work like this: Data Source=(local);Initial Catalog=dnntest;Integrated Security=true;

      DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase





      Veteran Member





        Joe,

        In addition to Brian's reply: the account that runs the application pool needs db_owner permission for the database (at least for installing DNN and extensions). Assuming your web server is called DNN-WEB and the application pool is called DnnAppPool, you have the following (Windows/integrated) logins to be created on SQL Server and assigned this role:

        1. If IIS and SQL Server run on the same machine: IIS AppPool\DnnAppPool
        2. If they run on different machines within the same domain: DNN-WEB$

        If they run on different machines which are not in a domain or not in the same domain, you have to create an SQL Server login and assign the db_owner role to the database. In this case, the connection string would look like

        Data Source=[DNNDatabaseSQLServerName];Initial Catalog=[DNNDatabaseName];User ID=[SQLServerLoginName];Password=[SQLServerLoginPassword]

        It is not recommended to use the db_owner role in normal operation. Let me write a blog about this in the next days...

        If you just want a test installation on a local machine, I recommend nvQuickSite for installing DNN. This saves a lot of headache.

        Happy DNNing!
        Michael

        Michael Tobisch
        DNN★MVP

        dnnWerk Austria
        DNN Connect





        New Around Here





          IIS and DB are on the same local machine. Here is my connection string in web.config.

          add name="SiteSqlServer" connectionString="Data Source=(local);Initial Catalog=dnntest;Integrated Security=true;" providerName="System.Data.SqlClient"

          and I get this - IIS Apppool\dnn is db owner for dnntest.

          DNN Error


          Connection To The Database Failed






          Veteran Member





            Can you connect to the database using SQL Server Management Studio and using those EXACT credentials?

            Is SQL Server set up for mixed mode authentication?
            Joe Craig
            DNN MVP
            Patapsco Research Group





            New Around Here





              I ended up creating a SQL Server user and added it to web,config. Made this SQL server user owner of dnntest database and then I was able to install. Adding IIS APPPOOL\DNN application pool to SQL Server didn't resolve the issue. IIS APPPOOL\DNN couldn't access the database.

              This connection string worked for me

              add name="SiteSqlServer" connectionString="Data Source=(local);Initial Catalog=dnntest;User ID=sqluser;Password=sqluserpassword" providerName="System.Data.SqlClient"

              Thanks eveyone for your time and help.






              Veteran Member





                Your IIS AppPool identity user needs to have access to the database as a dbowner and also full privileges to the website directory. Without these two prerequistes, you are likely to have trouble.

                Michael's suggestion to use nvQuickSite to do your local DNN installs is a good one. That way all of the connections between IIS, the database, and the website directory will be done correctly with no intervention required on your part.
                Joe Craig
                DNN MVP
                Patapsco Research Group





                Veteran Member





                  Here is the promised blog article...

                  Happy DNNing!
                  Michael

                   

                  Michael Tobisch
                  DNN★MVP

                  dnnWerk Austria
                  DNN Connect
                  You are not authorized to post a reply.

                  These Forums are dedicated to the discussion of DNN Platform.

                  For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                  5. No Flaming or Trolling.
                  6. No Profanity, Racism, or Prejudice.
                  7. Site Moderators have the final word on approving / removing a thread or post or comment.
                  8. English language posting only, please.

                  Would you like to help us?

                  Awesome! Simply post in the forums using the link below and we'll get you started.

                  Get Involved