title: Can't add SQL Server CE database using SQL Server Management Studio 2008
body: <p>I'm trying to add the Northwind SQL Server CE 3.5 version which is an <code>.sdf</code> to SQL Server Management Studio 2008 R2 but I'm getting the following error:</p>
  
  <blockquote>
    <p>Failed to retrieve data for this request.
    (Microsoft.SqlServer.Management.Sdk.Sfc)</p>
    
    <p>at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object
    connectionInfo, Request request)<br>
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.GetOriginalDatabaseName(String
    primaryFilePath)<br>
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.PopulatePrimaryFileData(String
    primaryFilePath)<br>
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile..ctor(SqlManagementUserControl
    parent, CDataContainer dc, String fullPath, String databaseOwner,
    ServerConnection connectionInfo)<br>
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.IsSelectedFileValid(BrowseFolder
    dlg)</p>
    
    <p>An exception occurred while executing a Transact-SQL statement or
    batch. (Microsoft.SqlServer.ConnectionInfo)</p>
    
    <p>at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteReader(String
    sqlCommand, SqlCommand&amp; command)<br>
    at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataReader(String
    query, SqlCommand&amp; command)<br>
    at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql
    execSql, String query)<br>
    at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection
    query, Object con, StatementBuilder sb, RetriveMode rm)<br>
    at Microsoft.SqlServer.Management.Smo.ExecuteSql.ExecuteWithResults(StringCollection
    query, Object con, StatementBuilder sb)<br>
    at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType
    resultType, StringCollection sql, Object connectionInfo,
    StatementBuilder sb)<br>
    at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult
    sqlresult, ResultType resultType)<br>
    at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult
    result)<br>
    at Microsoft.SqlServer.Management.Smo.PrimaryFile.GetData(EnumResult
    erParent)<br>
    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()<br>
    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request
    req, Object ci)<br>
    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object
    connectionInfo, Request request)<br>
    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object
    connectionInfo, Request request)</p>
    
    <p>C:\Program Files (x86)\Microsoft SQL Server Compact
    Edition\v3.5\Samples\Northwind_ce.sdf is not a primary database file.
    (.Net SqlClient Data Provider)</p>
  </blockquote>