.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.