SQL Server Compact Code Snippet of the Week #12 : get the SQL Server Compact runtime version
SQL Server Compact Code Snippet of the Week #12 : get the SQL Server Compact runtime version
Join the DZone community and get the full member experience.
Join For FreeSensu is an open source monitoring event pipeline. Try it today.
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;
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
Sensu: workflow automation for monitoring. Learn more—download the whitepaper.
Published at DZone with permission of Erik Ejlskov Jensen , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
{{ parent.urlSource.name }}