Could not open a connection to SQL Server

Discussion in 'Getting started' started by mainiabhay, Jul 17, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi guys,

    I changed my connection string by changing the database name, it showed me the error saying Could not open a connection to SQL Server
    Then i again changed the string back to what it originally was (what was working) it agian give me the same error.

    So even though its wroking fine on local web server its not working over the web.

    i got a reply from ASPDISCOUNT.NET saying i should check my weconfig file string, which is fine.

    It produces an error in XSD, i replaced that too with the right one but still not resolved.
    Please help.
     
  2. Hi,
    OK...First I have to ask, are you trying to get a SQL Express DB on-line?
    All the best,
    Mark
     
  3. I didn't get you?
    we have SQL server 2000 enterprise edition here, and its been working for 6 months now until i changed the query string from:

    <connectionStrings>
    <add name="RevisionConnectionString" connectionString="Data Source=SQLSERVER2;Initial Catalog=Revision;Integrated Security=True" providerName="System.Data.SqlClient"/>

    </connectionStrings>

    to:


    <connectionStrings>
    <add name="RevisionConnectionString" connectionString="Data Source=SQLSERVER2;Initial Catalog=Revisionold;Integrated Security=True" providerName="System.Data.SqlClient"/>

    </connectionStrings>


    it didn't work.

    then i changed it back to

    <connectionStrings>
    <add name="RevisionConnectionString" connectionString="Data Source=SQLSERVER2;Initial Catalog=Revision;Integrated Security=True" providerName="System.Data.SqlClient"/>

    </connectionStrings>


    and it still didnt work
     
  4. Hi,
    The reason I asked is that most of the Conn string questions in this forum are directed at issues with moving from Express to Web. ;-)

    Here's a valid Conn section, from my own web.config, showing what works.
    (Just replace the values listed, server, username, password.)
    All the best,
    Mark

    <connectionStrings>
    <clear />
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL_msftwise;User ID=SQL_msftwise_user;Password=****" providerName="System.Data.SqlClient" />
    <remove name="SQL_msftwise_userConnectionString"/>
    <add name="SQL_msftwise_userConnectionString" connectionString="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL_msftwise;Persist Security Info=True;User ID=SQL_msftwise_user;Password=****" providerName="System.Data.SqlClient" />
    </connectionStrings>
     
  5. Mark,

    i tried this

    <connectionStrings>
    <
    clear />
    <
    remove name="LocalSqlServer"/>
    <
    add name="LocalSqlServer" connectionString="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL_msftwise;User ID=SQL_msftwise_user;Password=****" providerName="System.Data.SqlClient" />
    <
    remove name="RevisionConnectionString"/>
    <
    add name="RevisionConnectionString" connectionString="Data Source=SQLSERVER2;Initial Catalog=Revision;Integrated Security=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>


    It didn't work, since we do not have passwords n user id do you i should replace my original string?
     
  6. Hi,
    Log into your DASP Control Panel and take a look in the section for the SQL Server addon you have, there is a full connection string with your needed info but the password is commented out, just replace that with password from your DASP account.
    Don't use the exact string I posted, you need to replace the Data Source, Catalog, User ID and Password...with your own to make it work.

    If you get stuck and need further help PM me with your account login and I'll write the needed conn string for you and PM it back.
    All the best,
    Mark
     
  7. don't know

    Mark, please check my PM.
     
  8. ..Just sent your a return PM ;-)
     
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