Question

By default, when you create a local database cache using the wizard provided by Visual Studio 2008, it will create a SQL Server Compact edition database for you, and provide you synchronization capability between the cache and remote SQL Server using Sync Framework (1.0). This allow us to provide the offline capability in our client server based application.

My question is, instead of using SQL Server Compact edition, is it possible to use SQL Server Express edition so that we can use stored procedures? All are clients are beefy laptop running on Core 2 Duo, so processing power is not an issue at all. To our user, offline is most valuable feature, though.

Plus, it will take us some major rewrite to convert all stored procedure code to C# middle tier code using LINQ. Finally and most importantly, our boss wants the business logic to be in stored procedures. SQL Server CE just won't cut it.

Was it helpful?

Solution

is it possible to use SQL Server EXPRESS edition so that we can use stored procedure?

Yes.

You can simplify installation and deployment by using Click Once.

If needed, you can limit the amount of memory used by SQL Express through issuing appropriate configuration commands.

Since your clients use laptops, you might consider providing an option to stop and start SQL Express from within your app, rather than having it auto-start as a service.

P.S. If you're using SPs, you may not need LINQ. ADO.NET can result in much higher-performance code, particularly if you can leverage features like command batching, async queries, multiple result sets, etc, that aren't possible with LINQ.

OTHER TIPS

Yeah, you can do that. You can have the installer install SQL Server Express onto their computers.

Only thing I'd warn though is that SQL Server can take up some extra RAM (200 - 500 megs) and it's not always going to be obvious to your users why their computer is consuming so much RAM all the time. If they all have plenty of RAM this isn't an issue but anyone with computers with less than 2 gigs might notice this.

You would be able to write stored procedures as well into SQL Server Express. I've used SQL Server Express for some products and it's perfect for most databases that I've needed to build since they never reach the limitations.

This article indicates that Sync Framework 1.0 does not support SQL Server Express as a client. Sync Framework 2.0 can support Express as a client.

In Sync Framework 1.0 –

We had 2 Database Synchronization providers available, namely SqlCeClientSyncProvider and DbServerSyncProvider. These providers support offline (or hub-and-spoke) scenarios –so, only client DBMS we could use was SQL Server Compact Edition and on the Server side we had the ability to use SQL Server or any other ADO .net compatible DBMS.

In Sync Framework 2.0 –

In addition to the older providers, we also have 3 new Database Synchronization providers, namely SqlSyncProvider, SqlCeSyncProvider, and DbSyncProvider. These new providers can be used with Collaboration as well as offline scenarios, thereby enabling any ADO .net compatible Database to participate as client or Server in offline scenarios or as a peer in collaboration scenarios.

Comment to Tim's answer above. I have actually more or less the same question as the initial question above. I am currently struggling to make my way through these version puzzles of Sync Framework, Sync Services, SQL Server versions, etc etc. and what one can use with which version.

I find there is a contradiction in the article that Tim refers to (above):

According to the answer to Question #13 in this article, it seems like SQL Compact is the only one that can be used with SF 1.0. Too bad for all those developing on ASP.NET and stuck with SF 1.0, because one gets an exception when trying to mary SQL Compact with ASP.NET (got it myself). Unless one have SQL CE v4 maybe?

"SQL Server Compact is not intended for ASP.NET development."

For instance:

http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/b8763568-c7b0-4e4a-bdf3-14969a0f67a0/

According to the answer to Question #3 of the same article, SF 1.0 is installed by default with SQL Server 2008 and SQL Server Express 2008. I can attest to that, I did not ask for it and it was there when I installed my stuff on the client Express.

This is one of many things that add to the confusion: How the heck can we easily figure out what to use or what we can use in each scenario/setup?

If it can help answering the original question, after a week of intensive research and struggling in C# related to synchronizing in the simplest possible scenario, here are my findings: Because SF 1.0 is installed with SQL Express 2008, one may conclude that they are usable together. WRONG. I tried everything. I found very little information on the Internet about marying the two and, therefore, they are not usable together. Don't waste your time. Yes you can use SQL Express, but with Sync Framework 2.0 only. That is my personal conclusion. Now that I know, I am about to install Sync Framework 2.0 on the clients (despite that complicated RFC and approval process prevent me to install anything on the server side). I believe in a centralized model (clients connect to a central server but does not connect together, and the server itself does not have the web app / IIS installed on it), the use of Sync Framework is exclusively for the client. Make sense?

Anyway thanks Tim for sharing this. I had read the FAQ already, but by viewing your post I went re-read it and realized I really should install 2.0 ;-)

Kindest Regards,

Zyxy

The automatic code generation by the LocalDataCache only supports SQLCE to the best of my knowledge. It's technically possible to sync SQL2008 Express to SQLServer but it seems to require a lot of code and is nowherere near as simple as the elegant SQLCE support in VS2008.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top