problems connecting to SQL Server 2005

Last post 07-01-2009 5:12 PM by rogriall79. 17 replies.

Sort Posts:

  • problems connecting to SQL Server 2005

    04-24-2009, 6:43 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     I uploaded my site to godaddy and I keep getting this when I sign into my site:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    I have seen this in a previous post but I am not sure how this applies to my site, here is my connection string

    <connectionStrings>
      <clear />
      <add name="AspnetdbConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\GNJDB.MDF;Integrated Security=True;User Instance=True"
       providerName="System.Data.SqlClient" />
      <add name="GNJDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\GNJDB.mdf;Integrated Security=True;User Instance=True"
       providerName="System.Data.SqlClient" />
     </connectionStrings>

    So do I delete this and replace it with this:

    connectionStrings>


    <add name="Personal" connectionString=" Server=p3swhsql-v07.shr.phx3.secureserver.net; Database=Personal; User ID=yourusername; Password=yourpassword; Trusted_Connection=False" providerName="System.Data.SqlClient"/>

    <remove name="LocalSqlServer"/>


    <add name="LocalSqlServer" connectionString=" Server=p3swhsql-v07.shr.phx3.secureserver.net; Database=ASPNETDB; User ID=yourusername; Password=yourpassword; Trusted_Connection=False" providerName="System.Data.SqlClient"/>

    </

    connectionStrings>

     

    I am new to this so I didn't even know I had to change anything in my web.config file and godaddy didn't say anything either.

    Thanks to anyone who can help me become less confused

    rogriall79

     

     

     

  • Re: problems connecting to SQL Server 2005

    04-24-2009, 10:26 PM
    • Contributor
      5,576 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    I have godaddy hosting also and my connection string looks similar but unless you renamed the database I think that could be the problem, take a look at mine.  If I remember right, I wasn't able to rename the db.  Also try removing spaces between the semi colon and the next item in the string.

    <add name="SiteSqlServer" connectionString="Server=whsql-v24.prod.mesa1.secureserver.net;Database=fro0809907092288;uid=myuid;pwd=mypwd" providerName="System.Data.SqlClient" />

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
  • Re: problems connecting to SQL Server 2005

    04-26-2009, 3:14 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     Ok I see.  I didn't change the name of my DB but how do I get the connection string from godaddy?  if I call will they give it to me.  Probably a dumb question but that seems to be my prob.  I was searching around the hosting part of my account and I cant really see how it get it.  how did you link it to their server?

  • Re: problems connecting to SQL Server 2005

    04-26-2009, 7:58 PM
    Answer
    • Contributor
      5,576 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    After I logged in, on the left navigation there is a link named "Hosting", click it.  On the next page it will show your hosting accounts, click on the account in Manage Account under the Control Panel header.  This will open another window, in which you click on the Databases in the Accordion control then click on SQL Server.  There it will show your SQL Server version and name.  If you click on the pencil it will display all your info with the exception of your password.

    Good luck, hope this helps

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
  • Re: problems connecting to SQL Server 2005

    04-29-2009, 11:55 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     Thanks that helped out a lot.  It works great now....

  • Re: problems connecting to SQL Server 2005

    04-30-2009, 6:09 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     OK I have one more question.  I actually have the connection to my DB but it only shows my ASP Tables and not my Products Tables.  I was wondering if you know whtI might be doing wrong.  I actually went through and got rid of all my login and membership pages and tables from my website to see what is wrong.  I am now thinking I might be using the wrong connection string.  I used the string

    • OLE DB, OleDbConnection (.NET):
    • Provider=sqloledb; Data Source=GNJDB.db.4160044.hostedresource.com; Initial Catalog=GNJDB; User ID=GNJDB; Password='your password';

    For my DB but only my ASP tables are showing.  Do you think it might be something else?  Should I use a different Connection string?  I am not sure why I can only see my ASP tables and not my Product Tables.  This is even after I deleted all login stuff from my site.

     

    It is starting to get to me a bit.....I really hope you can help, I am not sure why after connecting my DB only select tables are able to be used.

     

    Thanks RIch

     

     

    Filed under:
  • Re: problems connecting to SQL Server 2005

    04-30-2009, 8:38 PM
    • Contributor
      5,576 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    Any particular reason you are not using just a regular SQL client provider vs your OLE DB provider?

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
  • Re: problems connecting to SQL Server 2005

    04-30-2009, 8:53 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     Actually I don't know the difference but I will use this one instead and see how it works:

    • SqlConnection (.NET):
    • Data Source=GNJDB.db.4160044.hostedresource.com; Initial Catalog=GNJDB; User ID=GNJDB; Password='your password';

    Not sure what the difference is, I am still reading up on DB and programing so if this is the problem then I will have to look at it more.

     Is this what you meant by the regular SQL Client Provider?

     

  • Re: problems connecting to SQL Server 2005

    04-30-2009, 9:50 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     These r the one i am given......which do u recommend:

    • ODBC:
    • Driver={SQL Server}; Server=GNJDB.db.4160044.hostedresource.com; Database=GNJDB; Uid=GNJDB; Pwd='your password';
    • OLE DB, OleDbConnection (.NET):
    • Provider=sqloledb; Data Source=GNJDB.db.4160044.hostedresource.com; Initial Catalog=GNJDB; User ID=GNJDB; Password='your password';
    • SqlConnection (.NET):
    • Data Source=GNJDB.db.4160044.hostedresource.com; Initial Catalog=GNJDB; User ID=GNJDB; Password='your password';
    I am currently using the middle one.

     

  • Re: problems connecting to SQL Server 2005

    04-30-2009, 10:08 PM
    • Contributor
      5,576 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    Use the last one.

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
  • Re: problems connecting to SQL Server 2005

    04-30-2009, 11:35 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18
    <connectionStrings>
        <clear />

    <add name="GNJDBConnectionString" connectionString="Data Source=GNJDB.db.4160044.hostedresource.com; Initial Catalog=GNJDB; User ID=GNJDB;Password="mypassword"; Trusted_Connection=False"  providerName="System.Data.SqlClient" />

     </connectionStrings>

    This is my connectionstring, when i use this it doesnt show any of my actual products tables.  Could the problem be elsewhere? 

  • Re: problems connecting to SQL Server 2005

    05-01-2009, 12:31 AM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     I just went through my web.config and commented out all of the asp.net membership info to see if I could get it to work properly. it does.  I now want absolutely nothing to do with and login function and just want my DB to work properly. 

     Do I have to do anything with my web.config to get me DB to just show my products?  or to get teh connectionstring to recognize my GNJDB.  I have the correct connectionstring I still have no clue why it isn't showing up.

    When I click on anything that is supposed to display data this is what I get:

    Invalid object name 'Brands'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'Brands'.


    Thanks

  • Re: problems connecting to SQL Server 2005

    05-01-2009, 1:25 PM
    • Contributor
      5,576 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    When you look online at your GoDaddy database manager do you see your tables in that database?  You may have to use their tool to add them or try to connect via SSMS.

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
  • Re: problems connecting to SQL Server 2005

    05-01-2009, 3:55 PM
    • Member
      13 point Member
    • rogriall79
    • Member since 04-24-2009, 6:34 PM
    • Posts 18

     When I look on godaddy's database manager it only shows my asp tables and not my product tables.  they are in the same db so i am curious as to why it only shows half my tables.  So you are saying I should use their program instead of filezilla, I have never connected via SSMS.  Is it ant different?

  • Re: problems connecting to SQL Server 2005

    05-01-2009, 5:05 PM
    • Contributor
      5,576 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    The only way I was ever able to add tables to the database on GoDaddy was to use their tool.  Never tried to connect via SSMS as I am guessing GoDaddy wouldn't allow it.  Not sure how you use Filezilla to upload tables to a database but my guess is it didn't work.  There is a tool out there provided by Microsoft that will allow you to publish your db to a hosted provider.  What I would suggest doing is creating a backup of your db on godaddy, then coping the .bak file to your local machine, restore it to your local machine then make the mods to it and re-publish it to godaddy.

    Here is the tool

    http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

     

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
Page 1 of 2 (18 items) 1 2 Next >