Accessing database from external site

Discussion in 'Getting started' started by thintz, Nov 24, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am accessing my databases on discountasp.net from an external site. (Long story)
    I understand that I will need a different connection string? do I just have to modify the connection string shown in my control panel for my databases?
    I am in sort of a bind as my previous host keeps dropping my site and have moved everything, including moving all of my databases here.
     
  2. You should be able to use the same connection string shown in the Control Panel, just make sure you're using the correct password.

    If you're having problems connecting, it'd be difficult to say why from our end, so we'd recommend that you make sure your current web server is able to connect to our SQL server.
     
  3. I copied/pasted the connection string right out of the box int eh control panel but the password was shown as *****, I assumed that was just hiding it. do I need to enger the password in the string manually?

    Tom
     
  4. dmitri

    dmitri DiscountASP.NET Staff

    Yes, you need to replace ***** with your actual password.
     
  5. Yea, you will have to change it.

    The Control Panel just shows the ******* for security purposes, so your passwords aren't being shown in plain text.
     
  6. I notice that my user name is not spelled out in the connection string either, but I do see a "user" in the string. Do I have to replace that with my user name as well? Adding the passord did not fix it.
    (Can anyone tell I'm not so hot at this?)
     
  7. No, the username should remain intact actually.

    Are you getting any specific errors?
    Have you tried connecting to this database before using SQL Web Admin [sqlwebadmin.discountasp.net] or any other SQL Client?
     
  8. I am not getting any error messages from the site, but did get one from my site host saying I must have a static IP address to reach out to external databases.
    Whomever of you folks is closest to me, feel free to drop by and slap me on top of the head a couple times - if that fixes this anyway.
     
  9. That's a really odd request from them, but you shouldn't have any problems whatsoever connecting to the SQL Server URL from any other server.

    If they're requesting that from you, I'd have to recommend to contact them so they're able to assist you, as it appears they have a couple rules limiting the SQL Server access.
     
  10. I asked directly if there were conditions on the hosting server that would limit may ability to reach out to outside databases and the static IP was the only thing they said I needed to do. We'll see. It's not a big deal and if it fixes my problem, I'll be tickled pink.
     
  11. mjp

    mjp

    Seems like more trouble to keep the site at the current host than to move it here, but I'm sure you have your reasons.
     
  12. I would lOVE to just have my site at DiscountASP but it is huge in terms of disk space and traffic, like double to triple the alotment on the discountAsp servers. And, it is growing rapidly so that would always be an increasingly tough issue.
    I am using Xigla software that uses the databases and now I am wondering if I couldn't have that software running on the Discount server in my "site" there (I have a "site" as you know to get the databases).
    I also am wondering if the databases themselves could be goofed up. I don't have anything I am aware of to actually look inside the databases to see if the restore I did with the backups actually worked. I also have to see if the "name" of the databases remained the same. It looks to me like the name could be a little different because of some numbers and text they put before the name I have been using.
    Does it sound like I am shooting in the dark? Pretty much. Now things are getting a bit desparate.
     
  13. I have moved the site to an asp-friendly host, they have checked everything they can think of on thier end (includeing running similar external database calls that worked) and can find nothing. Tech support thought I might be entering the wrong passord so I went back through, reset the passwords, redid the connections string, reentered the (correct) password and nothing again.
    Apparently nobody or nothing is doing anything wrong, but it still doesn't work, though it did jsut as it is on a sderver that unfortunately couldn't keep the stie up 24 hours in a row. The database connection worked perfect though
     
  14. Glad to hear your site is working fine now
     
  15. That was with the old databases, these don't connect yet for some reason. The site iteself is fine, its the database connections that ain't getting it.

    Below is the whole string for database connection. I took out the passowrd bu it was right. If anyone sees something odd, I would deeply appreciate some insight!


    <!-- Database Connection String -->
    <add key="xlaALSconnectionstr" value="Data Source=tcp:sql2k802.discountasp.net;Initial Catalog=SQL2008_686065_thintzdb;User ID=SQL2008_686065_thintzdb_user;Password=******;" />
     
  16. Hi,
    Try it like this:

    <connectionStrings>
    <clear />
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k802.discountasp.net;Initial Catalog=SQL2008_686065_thintzdb;User ID=SQL2008_686065_thintzdb_user;Password=*****" providerName="System.Data.SqlClient" />
    <remove name="xlaALSconnectionstr" />
    <add name="xlaALSconnectionstr" connectionString="Data Source=tcp:sql2k802.discountasp.net;Initial Catalog=SQL2008_686065_thintzdb;Persist Security Info=True;User ID=SQL2008_686065_thintzdb_user;Password=*****" providerName="System.Data.SqlClient" />
    </connectionStrings>

    All the best,
    Mark
     
  17. You know that looks like three or four versions of the connection string right?
    Am I missing something there?
     
  18. ... :)
    I'll explain.

    1) "Clear" wipes the slate, any junk is removed.
    2) Remove and Add LocalSQLServer but we're tricking the machine.
    You see it can default to LocalSQLServer without our knowing, so let's fix that.
    3) Now we're going to add the DASP account SQL Server setting.
    First we'll Remove the name we plan on using, just for insurance. Clean slate.
    Now we add it, with Persist Security Info this time.

    If the settings are correct it is going to work because we did it all. ;-)
    Salute,
    Mark
     
  19. WE got it fixed. Took like 40 minutes on another server to create the databases, format them for the app and get them hooked up (first time on all four databases) and working smoothly with the applications on my site.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page