相关文章推荐
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 8 years ago .

If you're using Visual Studio > 2012 then you can use this extension: SQL Server /SQLite Toolbox Richard Garside Jan 23, 2015 at 10:47

Download and install LINQPad , it works for SQL Server, MySQL, SQLite and also SDF (SQL CE 4.0).

Steps for open SDF Files:

  • Click Add Connection

  • Select Build data context automatically and Default (LINQ to SQL) , then Next .

  • Under Provider choose SQL CE 4.0 .

  • Under Database with Attach database file selected, choose Browse to select your .sdf file.

  • Click OK .

  • Works great: here's a screenshot of it in action (see CodeCamper.sdf): twitter.com/johnleniel/status/470334781658783744 Leniel Maccaferri May 24, 2014 at 22:47 I tried this and got an error: that I needed to call SqlCeEngine.Upgrade() in order to use it. Entering that command in LinqPad did not work, so I made a quick console app to upgrade the file. Add references -> Assemblies -> Extensions -> System.Data.SqlServerCe , then new SqlCeEngine(@"Data Source=D:\mydb.sdf").Upgrade(); After running that, LinqPad worked nicely. RandomEngy Jun 11, 2014 at 20:50

    Try the sql server management studio (version 2008 or earlier) from Microsoft. Download it from here . Not sure about the license, but it seems to be free if you download the EXPRESS EDITION.

    You might also be able to use later editions of SSMS. For 2016, you will need to install an extension.

    If you have the option you can copy the sdf file to a different machine which you are allowed to pollute with additional software.

    Update: comment from Nick Westgate in nice formatting

    The steps are not all that intuitive:

  • Open SQL Server Management Studio, or if it's running select File -> Connect Object Explorer...
  • In the Connect to Server dialog change Server type to SQL Server Compact Edition
  • From the Database file dropdown select < Browse for more...>
  • Open your SDF file.
  • It didn't work for me, the open source Compact View mentioned by Ivan worked. I tried SQL Management Studio 2008 Express and my sdf file was Sql Ce version 4.0 Nikolaos Georgiou Jan 21, 2012 at 13:59 My answer edit was rejected, so excuse the poor formatting. The steps are not all that intuitive, and should be in the answer! (1) Open SQL Server Management Studio, or if it's running select File -> Connect Object Explorer... (2) In the Connect to Server dialog change Server type to SQL Server Compact Edition (3) From the Database file dropdown select <Browse for more...> (4) Open your SDF file. Nick Westgate Oct 31, 2012 at 21:41 I've seen this work on other machines, but doesn't work for me. "SQL Server Compact Edition" is not an option in the Connect to Server dialog for me. @Brakomen's alternative answer (opening in VS2012) did work for me. Richard Fawcett Jul 12, 2013 at 10:55 "SQL Server Compact has been dropped from Management Studio, use Visual Studio instead." Source Alex Oct 21, 2013 at 17:47

    and following the instructions there.

    If you're okay with them being upgraded to 4.0, you can open older versions of SQL Compact Databases also - handy if you just want to have a look at some tables, etc for stuff like Windows Phone local database development.

    (note I'm not sure if this requires a specific SKU of VS2012, if it helps I'm running Premium)

    Thanks Blakomen, best answer if you have VSS 2012 IMO. Unfortunatelly it was not OP's case, but it helped me. Tiago César Oliveira Mar 21, 2013 at 13:20 In VS 2013 I do not see the "Change..." button and no option for SQL Server Compact 4.0, even though I have it installed. The only thing that worked for me was with LINQPad. RandomEngy Jun 11, 2014 at 21:30
     
    推荐文章