{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner
sql,high-perf,tips and tricks

SQL Server Compact Code Snippet of the Week #12 : get the SQL Server Compact runtime version

Your app/web site may require a specific build version of the SQL Server Compact runtime, due to dependency on a bug fix, for example. This weeks code snippet will demonstrate how to get that information. I have an older blog post here, that goes into deep details about the various ways to get SQL Server Compact related version information.

To get the SQL Server Compact build version for 3.5 SP2 and 4.0, you can simply use:

var ver = new System.Data.SqlServerCe.SqlCeConnection().ServerVersion;

MSDN docs here.

For SQL Server Compact 4.0 SP1, this returns: 4.0.8876.1.

And for SQL Server Compact 3.5 SP2 CU6, the value would be: 3.5.8088.0

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks