SQL ce 3.5 Microsoft DAAB example

Topics: Data Access Application Block
Feb 16, 2009 at 1:35 PM
I've been looking for a good introduciton to using the data access application block in enterprise library 4.1 with a microsoft ce 3.5 database.

I have tried some tests in a test Windows mobile 5 application but cannot get the project to build. What I was really looking for was an introduction to how this works.

For example how can I use a datareader to get information out of my .sdf database?
Why are the duplicate methods i.e. ExecuteReader / ExecuteReaderSQL?
How do you reference the sdf file (on the target platform) in the database connection string?

I realise these are all pretty straightforward questions but any help would be much appreciated. Looking through google I get some examples, most of which tend not to be for SQLCE.

Thanks very much.
Feb 17, 2009 at 2:44 AM
Check out this tutorial by David Hayden on how to reference the sdf file - http://davidhayden.com/blog/dave/archive/2007/01/02/SqlCeDatabaseDataAccessApplicationBlock.aspx.
I haven't used SQL CE before but I believe using its method calls is pretty much the same as with other database providers.  As for your second question, it's not duplicated.  Both classes has an
ExecuteReader method which takes a parameter of string and an array of parameters.  However, the string parameter in the Database class is a name of a storedprocedure while in the SqlCeDatabase class, it is an actual sql statement. 


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Feb 17, 2009 at 12:52 PM
Thanks very much for your reply. I will take a look.