When to use .mdf and when .sdf?

asp.net-mvc database entity-framework sql vwdexpress

Question

After seeing a lot of things in the internet I haven't found any explanation between the two file types: .mdf and .sdf.

.sdf would be a compact version of SQL Server (.mdf) I believe. Still they appear utterly different.

Have followed the two tutorials on msdn, i.e. MVC Movie App and the Musicstore. Both use .sdf.

Partial quote (full): 'First of all it should be "|DataDirectory|ASPNETDBContext.mdf" (notice the extension difference). Your applic...'

Both tutorials have the connection string to .sdf, i.e.:

<add name             ="MovieDBContext"
     connectionString ="Data Source=|DataDirectory|Movies.sdf" 
     providerName     ="System.Data.SqlServerCe.4.0"
/>

<add name             ="MusicStoreEntities" 
     connectionString ="Data Source=|DataDirectory|MvcMusicStore.sdf" 
     providerName     ="System.Data.SqlServerCe.4.0"
/> 

Question:

My question is what to use where and when? More over why to use which where.

1
10
5/23/2017 12:09:10 PM

Popular Answer

SQL Server Compact (sdf files) popular in Windows phone for storing some data (small count of data), also it could be used in web sites, but it has poor performance, even SQLite is better.

SQL Server (mdf files) used in big sites with a lot of data. Its more powerful, but cant be used in phones and must be installed on servers.

Look this: Comparison of SQL Server Compact, SQL Server Express 2012 and LocalDB

14
9/16/2012 8:58:55 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow