# Thursday, 19 April 2007

As I was mucking around MSDN a few days ago I came across the article "Data Storage Architecture with SQL Server 2005 Compact Edition" It was essentially talking about where you could use the ever nifty SQL2k5CE. It also mentioned that you could use it with websites, something which I read from the SQL2k5CE Books Online that it wasn't supported. But the golden line in the article was this

If you choose to use SSCE for Web applications, some configuration is required to allow SSCE to be hosted in the Web application process.

I quickly rummaged through the documentation for SQL2k5CE more carefully this time, and I found this:-

AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true)

Aaaa.. the magic key! My eyes must have glazed over the paragraph the moment I read the part about ASP.Net not being a SUPPORTED host for SQL2k5CE. Essentially all you need to do is throw that line in your Application_OnStart event of your Global.asax file and you'll be able to use it in your ASP.Net application.

Wonder how performance is though, since the article mentions that SQL2k5CE should only be used on websites with a low performance of oh... <300~500 request an HOUR. I guess that would mean most personal websites that dont get slashdotted! ;)

Note that you can Post As GUEST as well.
blog comments powered by Disqus