locked
Specified SQL server not found RRS feed

  • Question

  • Hi, I am new to SQL server and I am trying to set up a SQL server compact database to use in a C# application on a Windows Mobile phone. I have created a .sdf file using "Add Connections" in Visual Studio 2008 and added it to the C# smart device project. I have populated the table and have been able to execute SL queries from the server explorer. But when I try to access the database from my C# code, I am getting the following error: "Specified SQL server not found: <path>\\MyDatabase#1.sdf".

    I am using the following connection string: Data Source=<path>\\MyDatabase#1.sdf;Persist Security Info=True, where <path> is the location of the .sdf file on my computer.

    Please help.

    Thanks,
    Sunday, September 27, 2009 12:39 AM

Answers

  • The error indicates that you are using a SqlConnection object. With SQL Compact, you should use a SqlCeConnection object.
    http://erikej.blogspot.com Erik Ejlskov Jensen - Please mark as answer, if this was it.
    • Marked as answer by rkabhi Sunday, September 27, 2009 7:13 PM
    Sunday, September 27, 2009 7:50 AM

All replies