Bite my bytes

What I learn by day I blog at night - A blog from Microsoft Consultant working from Ljubljana, Slovenia

  Home :: Contact :: Syndication  
  999 Posts :: 7691 Comments :: 235 Trackbacks

Search

Most popular posts
in last 180 days

Categories

My Projects

Archives

Stuff


Copyright © by David Vidmar
 
Contact me!
 
LinkedIn Profile
 
 
 

While preparing for one of my presentations an NT Konferenca 2007 titled "Pocket database: Microsoft SQL Server 2005 Compact Edition" I did some googling on the subject of running Microsoft SQL Server 2005 Compact Edition (formerly "Compact", formerly "Mobile", formerly "CE") under ASP.NET which by default results in error "SQL Server Compact Edition is not intended for ASP.NET development".

There are various blog posts around the web stating different things that aren't true, at least not with latest RTM version of SQL2005CE:

  • Dan, Roger and Anonymous Commenter say you should set "SqlServerCompactUnderWebHosting" but it doesn't work with RTM.
  • Steve says you should set "SqlServerEverywhereUnderWebHosting" - also doesn't work with RTM.

The right setting is "SQLServerCompactEditionUnderWebHosting". So, just put

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

in your code and you are go.

This was found on relatively unrelated MSDN page called Deployment Considerations. I was ready to go digging with Reflector but I was lucky with Google just before I did that. Looks Geoff was not that lucky

Posted on Thursday, April 19, 2007 3:30 PM | Filed under: Developement |

Feedback

# re: SQL Server 2005 Compact Edition and ASP.NET 4/21/2007 12:00 AM Munir
top

# re: SQL Server 2005 Compact Edition and ASP.NET 5/9/2007 10:04 AM maxime lamure
Great, thanks for this tip.

# re: SQL Server 2005 Compact Edition and ASP.NET 6/16/2007 6:01 AM Miguel Madero
Wow this was really helpful!!!
:D



# re: SQL Server 2005 Compact Edition and ASP.NET 3/10/2008 4:45 AM Cotfas Liviu
Thank you! :)

# re: SQL Server 2005 Compact Edition and ASP.NET 9/9/2008 11:38 PM Matt Jensen
You're the MAN! Thank you!

# re: SQL Server 2005 Compact Edition and ASP.NET 10/1/2008 9:10 AM steve peach
Thanks so much for posting the solution to allow asp.net to use compact server 3.5!

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

You really saved me a lot of time.
Steve

# re: SQL Server 2005 Compact Edition and ASP.NET 10/25/2008 12:54 AM Andy
Hats of to the man !
Grubbed around all night on my server trying to fix this, and lo...
just get the spelling right and it all works.

Someone buy them a beer !

# re: SQL Server 2005 Compact Edition and ASP.NET 4/28/2009 1:25 PM chanaka pradeep
WOW, thanks. otherwise i thought to convert mt .sdf DB to SQL SERVER edition
thanks.

# re: SQL Server 2005 Compact Edition and ASP.NET 5/29/2009 8:55 PM carlos
This is really good information. I was in need of this for a simple website.

# re: SQL Server 2005 Compact Edition and ASP.NET 7/29/2009 3:08 PM Alan Kelly
Thanks for this, really useful tip although why it couldn't just be used by default escapes me. SQL CE is great for little ad-hoc databases where you don't want the bulk of SQL Server.

# davetiyeci 11/2/2009 3:54 PM davetiye
güzel davetiye sözleri ve davetiye metinleri

# davetiyeci 11/3/2009 12:53 PM davetiye
güzel davetiye sözleri ve davetiye modelleri

# davetiye,davetiye sözleri 11/17/2009 9:55 AM davetiyeci
düğün davetiyesi ve davetiye sözleri

# re: SQL Server 2005 Compact Edition and ASP.NET 12/26/2009 10:44 AM Winjo
Your tip is the best. I really wanted to use compact edition but always fail. now I can my work!!

Thank you so much! you're the best!

# re: SQL Server 2005 Compact Edition and ASP.NET 5/15/2011 7:50 PM SpongeBob
GREAT THANKS ! :)

# re: SQL Server 2005 Compact Edition and ASP.NET 8/14/2011 5:57 PM Assimeng Mark Mensah
I'm a graduate from the University of Education, Winneba in Ghana
I want job so you could help me get one I will be very grateful

# re: SQL Server 2005 Compact Edition and ASP.NET 1/11/2012 7:32 PM Siva
Thanks you for great info

Comments have been closed on this topic.