Re: Error while opening SQL Server CE database

What namespace are you using? SqlClient or SqlCe? It looks like SqlClient.

William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)

"rkbnair" <rkbnair@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:21087A5A-2D48-4F05-875E-8D93C1F70D41@xxxxxxxxxxxxxxxx
I get the following error:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance

SqlConnection xx = new SqlConnection("Data Source=D:\\My Documents\\Visual
Studio Codename
Password =Ocean4578!");