Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 not able to connect vb.net with sqlserver2005 ent

Author  Topic 

sqllover
Constraint Violating Yak Guru

338 Posts

Posted - 2008-07-22 : 23:57:56
Dear Friend,

i am using vs2005 and sqlserver 2005 enterprise edition. when i am trying to connect with database i am getting the following errror

[COLOR="Red"]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)[/COLOR]

the following code i used to connect front end with database



Dim con As New SqlConnection("Data Source=localhost;Initial Catalog=sample;Persist Security Info=True;User ID=sa; Password = jimmy;")
con.Open()



how to over come the above mentioned error? pleae help me

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-07-23 : 04:27:54
see
www.connectionstrings.com

1. Dont use namedpipes. Use TCP/IP
2. Check your firewall settings
3. I would advice you put your connection strings in the web.config file
Go to Top of Page
   

- Advertisement -