asp.net connection problem with sql server 2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amjad

    asp.net connection problem with sql server 2005

    Hi i received that error when connection to sql server 2005 from work station .
    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: Named Pipes Provider, error: 40 - Could not open a connection to
    SQL Server)

    I was using MS Access front end but now i want to convert that application
    to web but connecting with sql server is getting that problem

    snap short of my code is
    SqlConnection myConnection = new
    SqlConnection(" Server=(DBServe r);uid=abc;pwd= password;Databa se=MYDBk");

    thanks
  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: asp.net connection problem with sql server 2005

    Open the SQL Server 2005 configuration tool and ensure the protocol(s) you
    need are enabled. By default, all versions of SQL 2005 are locked down a
    bit. This is esp. true with the Developer edition, which is set for "shared
    memory" only. Usually setting up TCP is plenty for web apps, even if named
    pipes is the top of your client stack, but you can enable both.

    NOTE: Get rid of the () around the DBServer conn string. It is unnecessary.

    NOTE: You can put conn strings in config and encrypt them in 2.0. Better
    than open strings in your DLL:


    --
    Gregory A. Beamer

    *************** *************** *************** ****
    Think Outside the Box!
    *************** *************** *************** ****
    "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
    news:DB499F93-E1FC-42B4-849C-C019EEDBF172@mi crosoft.com...[color=blue]
    > Hi i received that error when connection to sql server 2005 from work
    > station .
    > 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: Named Pipes Provider, error: 40 - Could not open a connection
    > to
    > SQL Server)
    >
    > I was using MS Access front end but now i want to convert that application
    > to web but connecting with sql server is getting that problem
    >
    > snap short of my code is
    > SqlConnection myConnection = new
    > SqlConnection(" Server=(DBServe r);uid=abc;pwd= password;Databa se=MYDBk");
    >
    > thanks[/color]


    Comment

    Working...