Erik Porter's Blog

Life and Development at Microsoft and Other Technology Discussions

News

    .NET Compact Framework "Gotchyas" for the Beginner

    I recently started doing some Pocket PC and SmartPhone development.  Being a total beginner at developing for mobile devices, I, of course, ran into quite a few “gotchyas” that can slow you down and be a little frustrating at times for we who have been developing a lot in ASP.NET and WindowsForms.  Here's a list (that I will keep adding to as I go along) of the things I've found that are different from non-mobile .NET development:

    General

    • Guid.NewGuid Method is not supported
    • DataSet.Merge Method is not supported
    • Clicking the “x“ or “ok“ in the top right of an app does not actually close it
      • This is important when you're debugging, because the it won't stop until the program actually stops
      • You can kill applications by clicking Start -> Settings -> Click on System Tab -> Memory -> Click on Running Programs Tab
    • If you use VB.NET and set the default for Option Strict On to be the default, it won't actually default in for Mobile apps
    • Web References don't hide all the “extra files“ like in non-mobile apps and don't support Dynamic URLs
    • Web Services can not be referenced by localhost for local development.  Use the name of your machine instead when specifying the URL
    • Once you have a Solution with a mobile project in it, you can then only add other mobile projects, not any other type of project

    SQL Server CE

    • smallint and tinyint can not be identity fields
    • The following field types do not exist
      • char
      • varchar
      • text
      • smalldatetime
    • Can't have more than one field in a Primary Key
    • When Committing or Rolling back a Transaction, the Connection is automatically destroyed
    • No multi-line statements
    • No Stored Procedures (actually nothing besides Tables)

    Helpful Links

    If you find any mistakes (I'm still a newbie), please let me know...

    These are just things that I have noticed for my particular applications so far.  I'm sure there are many more.

    Comments

    TrackBack said:

    # March 30, 2004 2:02 PM

    Mike Krisher said:

    Erik,

    Great blog. Just FYI. That "x" and "ok" bug has been apparent since the 2002 OS. There is a way to REALLY close an app by capturing the "x" or "ok" tap. I'll have to look it up in a book I have and I'll pass you the VB code.

    Are you writing the article just about Pocket PCs or are you touching Smartphones as well?

    -- Mike
    # April 14, 2004 12:09 PM

    HumanCompiler said:

    Hi Mike,

    The article is actually just about SmartPhones, but it just so happens that about the same time, they started having me do PocketPC apps as well.
    # April 14, 2004 1:15 PM