DNN Forums

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

XMod Pro Control Panel Connection String for additional Local Server database

Sort:
You are not authorized to post a reply.





New Around Here





    I posted this question on the XMod Pro site but haven't received a response.

    I have a second local SQL database (in addition to the DNN database). I am trying to connect to that database using XMod Pro > Control Panel > Manage Forms > New Form > Data Source: External SQL Server Database Table > Connection String:

    "Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|mssextradb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"

    Then I click "Load Tables" and nothing happens. I have tried various connection strings but I never get anything.

    Any advice will be GREATLY appreciated.

    Thanks,

    Mark

     






    Veteran Member





      are you using an attached database (listed in SQL Server Management Studio) or just a database file?
      in the first case, you whould need to provide server and database name instead of the file name.





      Veteran Member





        Marc,

        A good "tool" to get a connection string is to create a new textfile somewhere (e.g. "test.txt") and rename that to have "udl" as extension ("test.udl"). Then double click the udl file and establish a connection to that database. Save the file, and open it with any text editor, then you find a connection string you can use.

        Example:

        [oledb]
        ; Everything after this line is an OLE DB initstring
        Provider=SQLOLEDB.1;Password=MySecretPassword;Persist Security Info=True;User ID=SQLServerLogin;Initial Catalog=MyExternalDatabase;Data Source=SQLServerName\Instance
        
        

        Happy DNNing!
        Michael

        Michael Tobisch
        DNN★MVP

        dnnWerk Austria
        DNN Connect





        Veteran Member





          I have used this a lot in the past and id did work, although I edited my XMOD ascx templates directly as text files.
          You could first try the Reports Module to see if it's an issue with the connection string, or you could add it as an extra to web.config (In the end I did that for my Xmod Templates)






          New Around Here





            Did you try to integreate it with seprate website? I want to do this experient with my reviews blog. Can you help me regarding this?

            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