Connecting to database from Web

Discussion in 'ASP .Net' started by Lou Civitella, Mar 11, 2008.

  1. I created a test web site with VS2008 using Framework 2.0. Created a
    database in SQL Server 2005 and am able to connect to it without any
    problems. I then setup the database to be accessed using a public IP
    address. Changed the connection string in my web site to use the public IP
    along with the port, when I load the web site through VS2008 everything
    works OK. When I try to upload to my web site I get this error message.

    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: TCP Provider, error: 0 - A connection attempt failed because the
    connected party did not properly respond after a period of time, or
    established connection failed because connected host has failed to respond.)

    I added the SQL Server and Browser to the firewall as well as the port. I
    can connect to my database from a remote connection through SQL Server
    Management Studio. I only get this when the site loads from my web site.

    Any ideas?

    Thanks In Advance,
    Lou
     
    Lou Civitella, Mar 11, 2008
    #1
    1. Advertising

  2. Lou Civitella

    sloan Guest

    First off

    //this failure may be caused by the fact that
    under the default settings SQL Server does not allow remote connections.
    //

    is a message which ~may~ happen, but may not be the culprit.

    Its like
    "Your car is making a noise, it ~may~ be the brakes".

    However, it could be the issue.


    There is a "Surface Configuration Tool" under start / programs / Sql Server
    2005 /
    and there is a place to enable remote connections there.

    If its already enabled, then you'll have to check and recheck your
    connection string.

    Find out about the surface configuration first, then report back..and you'll
    get more concrete advice.




    "Lou Civitella" <> wrote in message
    news:...
    >I created a test web site with VS2008 using Framework 2.0. Created a
    >database in SQL Server 2005 and am able to connect to it without any
    >problems. I then setup the database to be accessed using a public IP
    >address. Changed the connection string in my web site to use the public IP
    >along with the port, when I load the web site through VS2008 everything
    >works OK. When I try to upload to my web site I get this error message.
    >
    > 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: TCP Provider, error: 0 - A connection attempt failed because
    > the connected party did not properly respond after a period of time, or
    > established connection failed because connected host has failed to
    > respond.)
    >
    > I added the SQL Server and Browser to the firewall as well as the port. I
    > can connect to my database from a remote connection through SQL Server
    > Management Studio. I only get this when the site loads from my web site.
    >
    > Any ideas?
    >
    > Thanks In Advance,
    > Lou
     
    sloan, Mar 11, 2008
    #2
    1. Advertising

  3. The Local and Remote Connections is selected and so is Using both TCP/IP and
    named pipes.

    "sloan" <> wrote in message
    news:#...
    > First off
    >
    > //this failure may be caused by the fact that
    > under the default settings SQL Server does not allow remote connections.
    > //
    >
    > is a message which ~may~ happen, but may not be the culprit.
    >
    > Its like
    > "Your car is making a noise, it ~may~ be the brakes".
    >
    > However, it could be the issue.
    >
    >
    > There is a "Surface Configuration Tool" under start / programs / Sql
    > Server 2005 /
    > and there is a place to enable remote connections there.
    >
    > If its already enabled, then you'll have to check and recheck your
    > connection string.
    >
    > Find out about the surface configuration first, then report back..and
    > you'll get more concrete advice.
    >
    >
    >
    >
    > "Lou Civitella" <> wrote in message
    > news:...
    >>I created a test web site with VS2008 using Framework 2.0. Created a
    >>database in SQL Server 2005 and am able to connect to it without any
    >>problems. I then setup the database to be accessed using a public IP
    >>address. Changed the connection string in my web site to use the public IP
    >>along with the port, when I load the web site through VS2008 everything
    >>works OK. When I try to upload to my web site I get this error message.
    >>
    >> 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: TCP Provider, error: 0 - A connection attempt
    >> failed because the connected party did not properly respond after a
    >> period of time, or established connection failed because connected host
    >> has failed to respond.)
    >>
    >> I added the SQL Server and Browser to the firewall as well as the port. I
    >> can connect to my database from a remote connection through SQL Server
    >> Management Studio. I only get this when the site loads from my web site.
    >>
    >> Any ideas?
    >>
    >> Thanks In Advance,
    >> Lou

    >
    >
     
    Lou Civitella, Mar 11, 2008
    #3
    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. Tom Wild
    Replies:
    0
    Views:
    6,715
    Tom Wild
    Aug 14, 2003
  2. Tom Wild
    Replies:
    1
    Views:
    10,952
    Kevin Swarts
    Aug 25, 2003
  3. Replies:
    0
    Views:
    653
  4. Big Charles
    Replies:
    3
    Views:
    320
    Alec MacLean
    Oct 29, 2006
  5. dominant
    Replies:
    14
    Views:
    187
    Ron Reidy
    Aug 12, 2003
Loading...

Share This Page