connecting vs 2005 to remote SQL server 2000

Discussion in 'ASP .Net' started by Me LK, Oct 30, 2007.

  1. Me LK

    Me LK Guest

    I did a search but could not find an aswer that worked so here it
    goes.

    I just did an upgrade from 2003 to vs 2005 express. I am using a
    remote sql server 2000. I specifically upgrade to make use of the
    login control. Everything upgraded fine and the site is working on my
    local machine.

    It seems that my site is trying to connect to a local database. I need
    it to attach to a remote database. I added a connection string to
    webconfig as follows

    <connectionStrings>

    <add name="myconnection"
    connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;database=name"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>

    but no change. I then tried to clear the database as I had seen in
    other posts. Then I got a machine.config error

    <connectionStrings>
    <clear />
    <add name="myconnection"
    connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;database=name"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>

    So how does one connect to a remote sql server 2000 so that it is
    recognized in the website admin tool?
     
    Me LK, Oct 30, 2007
    #1
    1. Advertising

  2. Me LK

    Dave Bush Guest

    Your problem is that the connection string it is looking for is the
    LocalSqlServer connection string (that's what gets used for membership
    and personalization.) Just create a duplicate connection string like
    the myconnection connection string that has a name of LocalSqlServer and
    you should be ok.

    I wrote this up a long time ago, sorry you couldn't find it.
    http://www.dmbcllc.com/Articles/WebDevelopment/MembershipDatabase/tabid/
    165/Default.aspx

    -----Original Message-----
    From: Me LK [mailto:]
    Posted At: Tuesday, October 30, 2007 2:08 PM
    Posted To: microsoft.public.dotnet.framework.aspnet
    Conversation: connecting vs 2005 to remote SQL server 2000
    Subject: connecting vs 2005 to remote SQL server 2000

    I did a search but could not find an aswer that worked so here it
    goes.

    I just did an upgrade from 2003 to vs 2005 express. I am using a
    remote sql server 2000. I specifically upgrade to make use of the
    login control. Everything upgraded fine and the site is working on my
    local machine.

    It seems that my site is trying to connect to a local database. I need
    it to attach to a remote database. I added a connection string to
    webconfig as follows

    <connectionStrings>

    <add name="myconnection"
    connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;databas
    e=name"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>

    but no change. I then tried to clear the database as I had seen in
    other posts. Then I got a machine.config error

    <connectionStrings>
    <clear />
    <add name="myconnection"
    connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;databas
    e=name"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>

    So how does one connect to a remote sql server 2000 so that it is
    recognized in the website admin tool?
     
    Dave Bush, Oct 30, 2007
    #2
    1. Advertising

  3. The first thing you must do is provide a <remove name="LocalSqlServer" />
    element because that is pre-defined in the master web.config. This then
    leaves you clear to provide your own.

    the connection string should look like:

    <add name="myconnection"
    connectionString="server=machinename;database=databasename;uid=username;pwd=password" providerName="System.Data.SqlClient"/>

    -- Peter
    Recursion: see Recursion
    site: http://www.eggheadcafe.com
    unBlog: http://petesbloggerama.blogspot.com
    BlogMetaFinder: http://www.blogmetafinder.com



    "Me LK" wrote:

    > I did a search but could not find an aswer that worked so here it
    > goes.
    >
    > I just did an upgrade from 2003 to vs 2005 express. I am using a
    > remote sql server 2000. I specifically upgrade to make use of the
    > login control. Everything upgraded fine and the site is working on my
    > local machine.
    >
    > It seems that my site is trying to connect to a local database. I need
    > it to attach to a remote database. I added a connection string to
    > webconfig as follows
    >
    > <connectionStrings>
    >
    > <add name="myconnection"
    > connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;database=name"
    > providerName="System.Data.SqlClient"/>
    > </connectionStrings>
    >
    > but no change. I then tried to clear the database as I had seen in
    > other posts. Then I got a machine.config error
    >
    > <connectionStrings>
    > <clear />
    > <add name="myconnection"
    > connectionString="server=sqldatabaselocation.com;uid=###;pwd=###;database=name"
    > providerName="System.Data.SqlClient"/>
    > </connectionStrings>
    >
    > So how does one connect to a remote sql server 2000 so that it is
    > recognized in the website admin tool?
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Oct 30, 2007
    #3
  4. Sanka Kolitha, Nov 4, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QW5keQ==?=

    Connecting to SQL Server 2000

    =?Utf-8?B?QW5keQ==?=, Apr 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    316
  2. Replies:
    1
    Views:
    2,083
    tdavisjr
    Dec 15, 2005
  3. =?Utf-8?B?TmVpbCBQYWRkb2Nr?=

    Connecting to SQL 2000 database with SQL 2005 tools installed

    =?Utf-8?B?TmVpbCBQYWRkb2Nr?=, May 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    420
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    May 2, 2007
  4. Wesley Chen
    Replies:
    0
    Views:
    247
    Wesley Chen
    Apr 7, 2009
  5. Wesley Chen
    Replies:
    9
    Views:
    263
    Sean O'Halpin
    Apr 14, 2009
Loading...

Share This Page