Server CE Database Development with .NET 162
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.
can't wait for the anti-.net comments (Score:2, Insightful)
Re:can't wait for the anti-.net comments (Score:5, Insightful)
(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.
Re:can't wait for the anti-.net comments (Score:3, Insightful)
If your company has any other
Re:can't wait for the anti-.net comments (Score:2, Insightful)
Re:can't wait for the anti-.net comments (Score:3, Insightful)
It's a friggin' file-based RDBMS - if you can even call it that - on an extremely compact piece of hardware. What do you expect? There is no service that runs and takes care of memory and performance issues, it loads the DB file when needed and pulls data directly from the file.
Frankly, I agree it isn't a great RDBMS for what you're probably used to, but it's great on a Pocket PC.
Re:can't wait for the anti-.net comments (Score:2)
I have been using PERST [garret.ru] targeted at developers who need an embeded database. But it's not relational, it's OO, which can be a benefit in some cases. You have to establish your own indexes and relationships between these objects. it's not a full blown SQL server, far from it. But on a small device overhead is everything and this thing is bare bones. It can be configured easily for the platform,
Re:can't wait for the anti-.net comments (Score:3, Informative)
Re:can't wait for the anti-.net comments (Score:2)
Sadly, the 400 MHz XScale PocketPCs are about 2x SLOWER than the older 206 MHz Strongarm PocketPCs. I've done C development for both. One test case takes 15 minutes on the 206 MHz Strongarm PocketPC. On the 400 MHz XScale PocketPC, the same test case take 30 minutes. So the XScale is about 4x slower per MHz than the older Strongarm processor.
I even used a beta version of Intel XScale-optimizing compiler. The object code as larger yet slower!!?
Re:can't wait for the anti-.net comments (Score:1)
Re:can't wait for the anti-.net comments (Score:2)
I have only done some basic testing on PocketPC 2003. It felt slower to me, but I was using a pre-production beta version of the new HP iPaq. I heard that it should be much faster because Microsoft finally created an XScale-optimized build of the PocketPC OS. Before Microsoft was only building for generic Strongarm and forcing XScale vendors to run the Strongarm build.
Microsoft builds CE for about a dozen of differenct processors. Why would separating XScale from Strongarm be so much more work? Maybe part
Moderators? (Score:2)
"uncle's brother's neice's sister"?
Are we witnessing the birth of another
Re:Moderators? (Score:1)
compact? (Score:1, Funny)
okay, perhaps, "microsoft's focus on security is compact."
before you flamebait me all to hell, its a joke and i use windows almost exclusively because it runs the software i need to run.
Re:compact? (Score:2, Funny)
Re:compact? (Score:1)
So the devil got Billy's soul, Billy got $$$, we got COM.
Figures.
The devil got the short end of that deal.
Now with
Re:compact? (Score:1)
Money talks, bullshit walks, I guess is what I'm saying.
Re:compact? (Score:1)
SQL Server CE (Score:1, Funny)
Re: (Score:3, Informative)
Sql Server CE? (Score:5, Informative)
Re:Sql Server CE? (Score:1, Interesting)
SQL Server CE is called "SQL Lite" internally at Microsoft. Different team, different thing than SQL Server.
Re:Sql Server CE? (Score:1)
Re:Sql Server CE? (Score:1)
Re:Sql Server CE? (Score:2)
Re:Sql Server CE? (Score:2)
Re:Sql Server CE? (Score:2)
Re:Sql Server CE? (Score:2)
Re:Sql Server CE? (Score:1)
Re:Sql Server CE? (Score:2)
Re:Sql Server CE? (Score:1)
Re:Sql Server CE? (Score:1)
Re:Sql Server CE? (Score:1)
Re:Sql Server CE? (Score:4, Insightful)
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.)
Re:Sql Server CE? (Score:2)
Re:Sql Server CE? (Score:2)
Also to note is the recent (last week?) merger of Firebird and Yaffil, its russian (commercial-product-for-a-while) counterpart. Yaffil
Name Conflit (Score:1)
You are talking about the browser, right?
Re:Sql Server CE? (Score:2)
SQL Server CE != SQL Server
.NET Compact Framework != .NET Framework
Pocket Word != Microsoft Word
Pocket Excel != Microsoft Excel
Windows CE API != Windows 32 API
See a trend there? Microsoft marketing tries to make them seem all the same, but no CE technology or app is even close to its Windows counterpart.
Which is a shame, Pocket PCs could be great mobile computing platforms if Microsoft dared more.
Re:Sql Server CE? (Score:1)
Our company uses Adaptive Server Anywhere on the Compact Framework. Not only does it perform better but we can replicate directly to Microsoft.
To hell with SQLite! (Score:1, Funny)
No bloat there, I'm sure (*cough* MSDE *cough*).
Technology in infancy... (Score:5, Insightful)
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.
Re:Technology in infancy... (Score:4, Insightful)
>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)
Re:Technology in infancy... (Score:2)
The Microsoft bashing is definitely present, and I would argue well-deserved, but it is not mindless. Microsoft are easily the world leader in the invention of new software development platforms that provoke huge investment in time and work by millions of developers, and which are then discarded after 2-4 years. Sun produced a couple of versions of Java. IBM... some C++ platforms, and then websphere. Oracle? OK, a bunch of platforms but mainly just Developer and Des
Re:Technology in infancy... (Score:1)
Regarding the rest of the bashing, you are being mindless. How can you compare the last 10 years of sw development in 3-4 sentences? (Not worth a shoe.)
PDA are in their infancy... (Score:2)
I do not accept that the resolution of the screen or the size of the device requires a new development platform (especially at the database level).
Re:PDA are in their infancy... (Score:2)
SQL is nothing new. What is so scary about having an embedded SQL server for CE, Linux, etc? There are number of them, it's not like MS thought of it.
We could go back to running DOS database apps. Paradox! dBase! YAY! Knock your socks off, do as ye will- but I want a more modern platform, with a more modern API and language
FUD (Score:3, Insightful)
This is pure and simple FUD.
Not ONE of these technologies listed is obsolete or not used any more.
Bash MS all you want, when you can back it up.
When you bash MS and don't back it up, it kinda null and voids all of your other arguments.
Re:Technology in infancy... (Score:2, Insightful)
>Visual Basic. C++.
Two languages which are incompatible as with any company. How many langauges has IBM pushed? And the end product are insanely compatable since you can create DLL/COM/ActiveX objects and work with each other.
How many OpenSource FORTRAN, LISP, PROLOG, Perl compiler/translator projects out there? How much better compatiblity do they have with each other?
>Office.
Their SINGLE office suite for the past 10 years. What makes you think that they ar
Just one example (Score:2)
A nice application, complex and sophisticated. It used numerous components (VBXs) and he spent about 4 months solid working on it.
He sold this for a year or so, then VB4 came out. He started on an upgrade, found that several of his VBX vendors had vanished, stayed with the old code.
Then VB5 came out. Completely incompatible.
He stopped maintaining the product, and swore to never use Microsoft's tool again.
Now: it may have the
Re:Just one example (Score:2)
Is that MS fault that the third party vendors had vanished?
Oracle has tonnes of drivers that work with only one verion. Sun and IBM have lots of integrated products that they will only support a particular version combination. I ask you again, what is so special about MS?
>it may have the same name (VB) but it is at least 3 totally incompatible products.
You seriously need to get some first hand
Re:Technology in infancy... (Score:2, Insightful)
Re:Technology in infancy... (Score:2)
Almost 20??
The SQL in my applications runs unaltered with MySQL. Now, perhaps I'm just not the kind of person who tries things like "INSERT INTO... SELECT FROM". Yeah, I should do more of those things.
To take a counter example, in an Oracle database, it is not even possible to get good performance on large tables without resorting to non-standard extensions such as hints. (Disclaimer: it's been a while since I Oracled, this may have been improved
Re:Technology in infancy... (Score:1)
Re:Technology in infancy... (Score:2)
Mumble grumble. You're right. Moderators, help unleash the hounds of hell on my humble head.
Re:Technology in infancy... (Score:2, Insightful)
Everything has a beginning. Second, yes we do need new technologies. The day we stop innovating and inventing we've become no more intelligent than the rest of the species on this planet. Mind as well we should start walking backwards.
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?
I would disagree. It is not the big
Change and the price of change (Score:2)
But you make the mistake of many people, namely to assume that change is equal to progress.
Change is only part of the cycle. The other part of the cycle is the refinement of techniques and maturation of knowledge that lets you exploit change to the fullest.
Imagine if every three years we had to discard languages like HTML and XML and start with new, incompatible co
Re:Change and the price of change (Score:2, Insightful)
Part of my point.
But you make the mistake of many people, namely to assume that change is equal to progress.
Change in itself can be tied to progress. Changes can happen based on progress, especially when it comes to new technologies (in their infancy) like the internet. The invention of HTML (the most simplistic example) lead to the first sharing of information
Re:Technology in infancy... (Score:2)
Yes. It keeps geeks like myself employed.
Re:Technology in infancy... (Score:3, Insightful)
Do you really think that the attitude of replacing old frameworks is exclusive to MS, who does it for financial gain? No. Open source communities are -constantly- reinventing the wheel - look at all the open source projects out there just for word processing; don't you think they could share a little bit more of a common codebase, say, for the inport/export of 3rd party file formats? That would m
The difference is the motive (Score:2)
No-one should pay to upgrade to a new platform because the vendor decides it's timely.
Every responsible OO project starts by defining standards that will last years, decades (look at OOorg's document formats). Every responsible OO project sweats blood and tears to ensure that new releases are compatible with old ones.
How many versions of PHP have been incompatible with previous ones?
How many versions of Perl? Of Apache?
Now th
Re:Technology in infancy... (Score:2)
Somebody please port MySql :) (Score:4, Interesting)
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 [kaione.com] that are crippled by this horrific database solution that could be killer apps with a free backend.
Re:Somebody please port MySql :) (Score:3, Informative)
http://www.sqlite.org/
Enjoy,
Re:Somebody please port MySql :) (Score:2)
Please don't post that link about mysql's supposed better performance. It likes to choke after dealing with much MUCH larger sets of data. But I digress.
I'd imagine something MUCH smaller, like mini sql [hughes.com.au] or SQLLite
Re:Somebody please port MySql :) (Score:2)
I can't say I've used this particular MS SQL for CE product- but I have used the built-in database, which allows happy queries. As well as SQLlite on the Zaurus. Both seemed a lot faster and provided more enjoyable solutions for me, the de
..if you leave the front door open... (Score:3, Funny)
It will be secure if you leave the front door open, but have a tiger pit cleverly disguised just inside the doorway.
Thieves tend to go to the path of least resistance, and unless they see one of their criminal compatriots plummeting into the tiger pit, or hear the horrible screams that follow, this is their most likely point of attack.
Or was that just a metaphor?
Re:..if you leave the front door open... (Score:1)
Not at all, friend! But I prefer the moat surrounding my home webserver filled with ill-tempered sea bass (with frickin' lasers!).
free and high quality alternative (Score:4, Interesting)
The very high quality embeddable SQLite database has several ports to .NET -- see the web site [sqlite.org].
Re:free and high quality alternative (Score:2)
So let me see if I get this straight... (Score:3, Insightful)
So, if I'm reading this right, the way this is supposed to work is:
1) You bind your GUI controls to a SQL server database using the SQL CE library installed on your PDA.
2) When a GUI control needs to update the data, or refresh it's view of the data, it performs a query using SQL CE.
3) SQL CE then transforms that request into an XML document, sends it over a (presumably) wireless network connection, to SQL Server.
4) SQL Server then processes the request, generates an XML response, and then the whole thing runs in reverse until the response gets back to the control, which can then update itself with the new information.
Is this really the way this thing is supposed to work? Please somebody tell me that I'm reading this wrong.
SQL statements are great when you're trying to optimize for query efficency, but they're awful when you're trying to optimize for network latency/bandwidth. This is because SQL is based on the idea that you perform operations over a persistant connection, because establishing that connection and performing the query is usually the bottleneck.
But any wireless developer will tell you that latency/bandwidth is the major bottleneck in a mobile application. When you're sending data over CDMA/GSM networks, the best data rate you can hope for is 192kbps, and forget about low latency. This means you have to package your requests in a big bundle and do them all at once. Which means you need something a little more coarse-grained than SQL.
I suppose if you assume that your application will always have 802.11 access, this could be a good model. But otherwise you're going to be waiting 5-10 seconds every time you click a button, change a setting, or scroll down through a list. Which means nobody is going to actually use your application because it's a grand waste of time.
Re:So let me see if I get this straight... (Score:3, Informative)
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/he
Re:So let me see if I get this straight... (Score:2)
It's not a new approa
Re:So let me see if I get this straight... (Score:2)
Assuming the steps you stated above are correct and the data itself resides on a server and not the PDA, I don't really see the problem. In the infrastructure you des
I recently clustered 26 SQL CEs (Score:2, Insightful)
Performance was good unless you wanted the results sorted
Re:I recently clustered 26 SQL CEs (Score:1)
Important for Robust Applications (Score:2)
Why is this a bad thing? (Score:2, Insightful)
PDA's these days are getting more and more powerful. They're already as powerful as what was on the desktop less than a decade ago, and they're catching up fast. It's not unreal that in 5 years we'll have PDA's capable of running Half Life 2 and Doom 3. I mean, today's PDA's can already run Quake 1 [pocketmatrix.com]
Re:Why is this a bad thing? (Score:1)
Re:Why is this a bad thing? (Score:1)
Re:Why is this a bad thing? (Score:3, Interesting)
A PDA should be using a database as it's central store as it is. CE already includes a database system, though the SQL CE has more features. The NewtonOS and PalmOS both do very well by having a database at their core. I don't care if it's a sql-based relational or object database, it just makes more sense.
The PDA is a chance to start over. With different OSes and CPU archs, compatibility isn't a big deal as it is on the desktop, where it has held back develop
Comment removed (Score:3, Funny)
pipe dreams (Score:1, Interesting)
There are already wireless devices for field force applications, which have a database on the device. And guess what, they don't use Sql server. All
Let's see... (Score:1)
Compact.
(pause)
Bwahahahahaha!!!!! BWAHAHAHA!!!
Why? (Score:2, Interesting)
On the PDA, throw a 802.11b card in when at the office and some sort of cellular card for when you are out and about. The only software you need on the PDA is a good web browser. Bandwidth is much less of a issue because all you are transfering back and forth is simple HTML.
Kidding right? (Score:2, Funny)
Re:Kidding right? (Score:1)
Remember, this is Microsoft we're talking about. It should go, "When all you have is a hammer, everything looks like your thumb."
AAAAGGHH! My eyes!!! Make the bad man stop!!!! (Score:2)
Re:AAAAGGHH! My eyes!!! Make the bad man stop!!!! (Score:1)
Guess it just goes to show you can't make everyone happy.
constructive criticism (Score:2)
Hi, dude.
I'm not trying to discourage you from writing reviews. I can tell you enjoyed this book, but your writing style distracts from your message. Please omit phrases that take up space without adding meaning.
Do you work for the Department of Redundancy Department?
How many times did you say "let's face it" in this article? Once is too many.
H
This just seems ridiculous to me... (Score:3, Interesting)
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.
Re:This just seems ridiculous to me... (Score:2)
speedy and compact (Score:2)
Much better support for this type of thing on Palm (Score:1)
WOW (Score:2)
60 posts talking about a Microsoft fledgling technology here says so much more than 300 slashbots flaming each other on the other "Microsoft's New Core OS Team Learning from Linux" thread.
Microsoft is a smart company. No really, they must be. If you have shed loads of money, you can pay lots of smart people enough money to make them work hard enough to roll out products which will do something "acceptably well" at worst, "reasonably wel
I can tell you what's not a database (Score:4, Funny)
Re:I can tell you what's not a database (Score:1)
Re:Seems really odd (Score:3, Funny)
Re:Seems really odd (Score:3, Informative)
Re:Seems really odd (Score:1)
However what I have noticed is that since SQLServerCE supports such a vast majority of the interfaces in the OleDB specification, (in someways it is more conformant than SQLServer 2000) I suspect that the engine is der
Re:CE??? (Score:2, Insightful)
How's stupid enough to run their database server on Windows CE anyway?
Don't think this is a huge focus for Microsoft, they're practising their tried and true method of "throw enough shit against the wall and some of it will stick" marketting. Assuming this product gets a decent foothold then you'll see them really push it.
Re:CE??? (Score:1)