• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution
    Highlighted
    Helper V

    SQL Server Connection Strings in web.config

    I have a shared Windows Plesk hosting plan.

     

    I have created a SQL Server database. I need to specify the connection string for it in my web.config file.

     

    I have found Find your connection strings | Web & Classic Hosting - GoDaddy Help but there are no Actions next to the database. I found Connecting to a SQL Server Database Using ASP.NET 3.5 | Web & Classic Hosting - GoDaddy Help but there is no Server section of my Hosting Control Panel.

     

    Based on those, it seems that connection strings are relatively simple. However see GoDaddy Database Connect example? | The ASP.NET Forums. Wow, there are many numbers and codes in that, so I think it would be foolish to attempt to figure it out myself.

     

    What I do see in my Databases section is a link for Webadmin and when I click that I get a page not found error, it is trying to go to a mssql subdomain of my plan's main domain and that page does not exist.

     

    I used Visual Studio to create an ASP.Net Web Forms Site. I modified the pages a bit but I have not modified the logic. Since it is created with a registration feature it uses a SQL Server database. The SQL Server database files (mdf and ldf) have been uploaded but I assume I cannot use them. Can I? If not then I will need to create separately the relevant tables in the database I created.

     

    This is where Web Deploy would likely help.

    1 ACCEPTED SOLUTION

    Accepted Solutions
    Highlighted
    Helper V
    Solution

    Re: SQL Server Connection Strings in web.config

    In the Databases page there is a Webadmin link for each database. That link did not work for me because my account's main domain did not have an A record for the mssql subdomain. When I finally got that done, I can get a connection string for each database from the myLittelAdmin tool.

    View solution in original post

    5 REPLIES 5
    Highlighted
    Community Manager
    Community Manager

    Re: SQL Server Connection Strings in web.config

    Hey @SamHobbs

     

    The articles you've linked are for our Classic and Web Hosting accounts, which are different from Plesk. That's why the instructions aren't working out for you. 

     

    In looking into how to write a connection string, I came across information that suggest you could do it with the following code:

    <connectionStrings>
    <add name="myConnectionString" connectionString="server=localhost;database=myDb;uid=myUser;password=myPass;" />
    </connectionStrings>

    Obviously you'd need to update the information for your situation, but that format may help. Also, as far as the server address goes, please take a look at this article as "localhost" won't work for our Plesk accounts. 

     

    Another Community member might be able to give more information, but still hope this helps.

     

    JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.
    Highlighted
    Helper V

    Re: SQL Server Connection Strings in web.config

    Thank you, @.

     

    I have since installed DNN (DoNetNuke) and I can use it's connection string as an example. It is:

     

    Server=(local);Database=DotNetNuke;uid=;pwd=;

     

    I have used that for my application except I changed the database and I specified a user and password. I am still getting a 500. So I need to research how to diagnose that and then work on the connection string if it is still a problem.

    Highlighted
    Helper V
    Solution

    Re: SQL Server Connection Strings in web.config

    In the Databases page there is a Webadmin link for each database. That link did not work for me because my account's main domain did not have an A record for the mssql subdomain. When I finally got that done, I can get a connection string for each database from the myLittelAdmin tool.

    View solution in original post

    Highlighted

    Help with Web Config Question for a SQL Server Database

     Hello: I have built an ASP.NET website using Visual Studio. I have a form that is connected to a small SQL Server database. It works fine locally, but when I uploaded the site to GoDaddy, something happened and I cant access the site. I assume it has something to do with the web.config file and I probably need to code it to something different. Right now it is:

    <configuration>
    <connectionStrings>
    <add name="ConnectionString" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\EDM.mdf;Integrated Security=True"
    providerName="System.Data.SqlClient" />
    </connectionStrings>

     

    Would I just need to switch out the text in Red to something else?

    Highlighted

    Re: Help with Web Config Question for a SQL Server Database

    Go to godaddy application hosting domain management

     

    select your database , it will be aligned with a server address 417.25.598.25 like that

     

    give the IP address in the Data Source = "" filed and check it