asp.net connection problem with sql server 2005

G

Guest

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=(DBServer);uid=abc;pwd=password;Database=MYDBk");

thanks
 
C

Cowboy \(Gregory A. Beamer\)

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:
http://msdn2.microsoft.com/en-us/library/zhhddkxy.aspx

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top