Slashdot Mirror


Server CE Database Development with .NET

William Ryan writes "SQL Server CE is Microsoft's preferred database backend for its Compact Framework initiative. Compact Framework is a cool technology, but it's still in its infancy. This book does a lot to help you get started using SQL Server CE." Read on for the rest of Ryan's review, or revisit his November review of a related book, The Definitive Guide to the Compact Framework . SQL Server CE Database Development with the .NET Compact Framework author Rob Tiffany pages 450 publisher Apress rating 10 reviewer William Ryan ISBN 1590591194 summary A start to finish discussion of using SQL Server with SQL Server CE on the Compact Framework

This book comprises 10 Chapters in just under 450 pages, including the indexes and usual book stuff. Since CE supports ASNI Sql, there are a few chapters that discuss using SQL to manipulate databases, which are probably not necessary for most database programmers. Chapters 4-8 are dedicated to DDL (data definition language), DML (data manipulation language), and taking advantage of metadata. It's a good discussion of these subjects, and I guess an author must include them to be thorough, but if you aren't that familiar with SQL, you probably have some learning to do before diving into data-driven PDA apps.

Enough about the background, though. The book really excels in two areas, one of which I think is probably useful to any developer, even if you don't use the Compact Framework or Microsoft Products. That area is security.

Far too many developers blow off security concerns, or claim to care but do little or nothing about actually increasing security. Let's face it: no matter how secure your OS is, no matter how killer your firewall is, today there are a lot of people trying to break your app and they aren't always outside of your company. Tiffany points to a GIGA Information Group article criticizing the industry for ignoring security on mobile devices.

A lot of what he says is focused on security issues that are 'common sense,' and yet ones that people ignore all the time. It's kind of a shame that a writer needs to explain the benefits of using 'Strong Passwords,' but let's face it, no matter how well you write your app, it won't be secure if you leave the front door open.

In no way am I saying that the author's discussion of security is limited to such elementary topics, but he does a great job of bringing many issues into focus and suggesting ways to deal with them.

The other area that this book really excels in is getting you through replication. This is not a fun topic if you don't know what you are doing and there isn't a lot of literature out there to help you get through PUSH/PULL subscriptions and the like. Pragmatically speaking, of the topics this book covers, Tiffany's coverage of replication is probably going to benefit people the most, because if you can't sync your PDA with your server, you are effectively out of gas. If you aren't a Sql CE user you won't appreciate the value of this chapter, but love MS or hate them, the newsgroups and forums are filled with folks with the same sorts of problems that the author works diligently to get you through.

It's hard to know what will and won't work yet on the Compact Framework and CE. It's quite helpful to have a list of common functions that are supported listed in depth -- another thing I liked about this book.

What else? Well, the text was well written, very similar to his last book on Pocket Access (Pocket PC Database Development with eMbedded Visual Basic) and easy to read. If you are a total newbie to CE, you can use this book and hit the ground running. Everything that you need to write professional apps is included, and I can't find anything that Tiffany omitted.

I really appreciate the fact that the author wrote an entire book on such a niche subject. Many areas, particularly the Compact Framework, don't have a lot of literature on them and if you are writing SQL Server CE, you are on your own...until now.

If you develop in CE, or plan to, this book is a Must Have.

You can purchase SQL Server CE Database Development with the .NET Compact Framework from bn.com. Slashdot welcomes readers' book reviews -- to submit a review for consideration, read the book review guidelines, then visit the submission page.

10 of 162 comments (clear)

  1. I can tell you what's not a database by Trigun · · Score: 4, Funny

    MSSQL CE, that's what.

  2. Sql Server CE? by Hayzeus · · Score: 4, Informative

    Geez -- a crippled db platform if there ever was one. Calling it "SQL Server" is really a major misnomer -- the two are not even remotely similar in even basic features. Obviously, this would be expected to some extent -- but the name tends to mislead. I had the misfortune of working for an employer who wanted the same application working on both SQL Server and a handheld version on CE. They expected significant code to be shared between the two, and ultimately got a nasty surprise when this proved infeasable, given the alotted dev time frame.

    1. Re:Sql Server CE? by Unordained · · Score: 3, Insightful

      That's why I look forward to the completion of a few last (for this) features in Firebird (the database server) -- they have an 'embedded' version that sits in a .dll and acts exactly like the server version as far as the calling program is concerned. It's the same engine code, so the same SQL is supported, the same features available. It can still load UDF libraries (the same ones it loaded as a server) but won't accept connections from other programs. If you want several programs to access the same file at the same time, you'll have to do that yourself. It's already great for building single-user programs to be distributed to clients who wouldn't want a "full-blown" database server running (really, it is, but at least it's not listening to any ports.)

      Firebird/Interbase has always been rather small -- 10 meg install, very little memory usage. The main problem porting it to PDA's and other embedded devices was its loopback / inter-process-communication systems. Its shared-memory method wasn't completed (though from what I hear, they have it working in development versions, and the new method speeds up the server quite a bit as well) and it relied on 127.0.0.1 loopback. Windows CE didn't allow for that (no ethernet interfaces at all by default, not even lo) and thus the server couldn't talk to itself. (It tends to use multiple processes.)

      Regardless, Firebird will most likely be available for embedded devices soon, run quickly and quietly, and won't be a stripped-down version at all. Code written for large multi-user environments would still work, but you might have to wait a bit longer for your huge reports.

      (And yes, I feel fine writing this without being too concerned about vaporware -- it's already proven technology, it's actively worked on, and the Microsoft thing isn't any closer.)

  3. Technology in infancy... by heironymouscoward · · Score: 4, Insightful

    Do we really need more technologies in their infancy? Is it not one of the biggest problem in this industry that we keep inventing new ways of doing the same stuff, throwing out entire generations of products and developers each time?

    We need ways to make existing good code last longer, not new frameworks to waste time on.

    But... sigh... I don't expect that kind of attitude from Microsoft. One more reason to avoid such platforms like the pest.

    --
    Ceci n'est pas une signature
    1. Re:Technology in infancy... by GoofyBoy · · Score: 3, Insightful

      >Do we really need more technologies in their infancy?

      >But... sigh... I don't expect that kind of attitude from Microsoft.

      Why do you think that this is a MS issue?

      What about IBM? Sun? Oracle? What about over half OpenSource projects?

      (Or perhaps I should be used to the mindless MS bashing around here)

      --
      The surprise isn't how often we make bad choices; the surprise is how seldom they defeat us.
  4. Somebody please port MySql :) by Mean_Nishka · · Score: 3, Interesting
    I'm so desperate to see a Mysql port to Windows CE.. I've been running this along with PHP/Apache on my Sharp Zaurus and that platform proves it's possible to do this stuff with open source software and 206mhz Strongarms.

    While I haven't been interested in shelling out the $$$ for Microsoft's server product (getting data back to the desktop database is important to me) I can say that I haven't found any database solution that operates as quickly as MySql on a PDA.

    My Zaurus is running as a full fledged server and its rock solid. Even the desktop ODBC connector is able to pull data into my windows apps at a surprisingly fast rate of speed. In a word it's simply awesome. I just wish my PHP skills were better.

    For the mortals Microsoft offers an Access compatible format (pocketAccess) that's horribly limited and slow. There are some great PocketPC database apps that are crippled by this horrific database solution that could be killer apps with a free backend.

  5. free and high quality alternative by e4liberty · · Score: 4, Interesting

    The very high quality embeddable SQLite database has several ports to .NET -- see the web site.

  6. Re:So let me see if I get this straight... by skubalon · · Score: 3, Informative

    You may not be reading this wrong, but it is wrong nonetheless.

    SQL CE data resides on the Pocket PC, however it can be replicated to a grown up SQL server as needed, and provided proper connectivity.

    A typical use of this technology is a driver in the field. They get their data replicated down from the SQL Server, then they head off for a day off deliveries. Transaction are then done by the driver on the SQL CE side. He/she brings it back to the loading dock at the end of the day and replicates his/her transactions back to the SQL server. I know that Nabisco is currently doing exactly that.

  7. Re:can't wait for the anti-.net comments by Anonymous Coward · · Score: 5, Insightful
    "no, really, i can't. bashing things out of ignorance is fun and easy."

    (Posting anonymously to protect myself and my employer).

    No ignorance here. I worked on a .NET Compact Framework (via VB.NET) + SQL Server CE application in the earlier part of 2003. Note that while they integrate with their namesakes, .NET CF and SQL CE's implementations appear to share almost nothing with their desktop counterparts.

    I cannot emphasize strongly enough how much this stuff sucks.

    Let's display a form with maybe 10 elements (a few text fields, a few static text labels, a few command buttons). It takes maybe half a second to a second, highly visible control-by-control drawing that the user can see.

    Let's perform a simple query, like SELECT id, name FROM items WHERE parentid = , returning a dozen or so rows. Yep.. half a second. From what I could see a lot of overhead was involved in passing the data from SQLCE to .NET, representing it all as ADO.NET or whatever objects along the way..

    By the time you're bringing up a form, performing a couple of queries and throwing that data in said form, the user is waiting a couple of seconds. Every. time. they. tap. something. It is not good enough. The resulting application is a joke.

    Databases can be big, so you might want to put them on external media ie a compact flash card. Except you point SQLCE at a db on a card and it just doesn't frickin work!

    This is all based on a fastish (400MHz XScale CPU iirc) Dell Axim. Don't even think about throwing this stuff on an older device.

    By the way, Microsoft .. requiring a total of about 8 megs of runtimes (.NET CF + SQL CE) is not something handheld users are accustomed to.

  8. This just seems ridiculous to me... by AmazingRuss · · Score: 3, Interesting

    ...why separate the database engine from the development tool on a palmtop, where efficiency is paramount? Do they expect people to use a palmtop as a db server or something?

    Something like Foxpro or Access, with integrated database support, would make a helluva lot more sense. The latest version of Foxpro for the PC has a smaller runtime than what they are cramming on there for SQL CE for chrissakes! It's fuggin silly. What gets IN to those people?

    10 years ago, I was putting the entire foxpro for dos development environment on 1 meg HP xxLX palmtops, and it worked really well. Full portability between desktop and palmtop, good performance, and good stability. Why have we taken such a giant step backwards that despite the hardware being 100 times better, we can no longer build decent software to run on it?

    Everything MS does anymore should be accompanied by clown music.

    I am truly starting to believe that MS is going to be a niche player like Apple in 10 years...an idea I would have laughed at a few years back. I don't LIKE this idea...it means I have to spend a lot of time retraining...but the writing is on the wall.