You are previewing Microsoft® .NET Compact Framework Kick Start.
O'Reilly logo
Microsoft® .NET Compact Framework Kick Start

Book Description

The primary goal of .NET Compact Framework is to bring the familiar experience of developing .NET applications for the desktop to the device world. Of the approximately six million Microsoft desktop developers in the world, it is estimated that perhaps two hundred thousand will turn their attention to the device world using the enabling technology of the .NET Compact Framework.To facilitate the goal of showing readers how to develop applications for the .NET Compact Framework, the book contains in-depth treatment in the following topic areas: Windows Forms and Threading, Network Programming, ADO.NET Dataset, XML Serialization, SQL CE, Web Services, and performance management. Each concept is accompanied with a sample application that illustrates its implementation on the .NET Compact Framework. For the convenience of the reader, each sample application will be offered in both C# and Visual BASIC. Developers can use this source code as a springboard for creating their own device side database applications.

Table of Contents

  1. Copyright
  2. About the Authors
  3. Acknowledgments
  4. We Want to Hear from You!
  5. Introduction
  6. Setting Up Your Development Environment
    1. Smart Device Extensions and the .NET Compact Framework
    2. Targeting Nonstandard Devices
    3. In Brief
  7. Introducing the .NET Compact Framework
    1. Why the .NET Compact Framework?
    2. Examining the .NET Compact Framework in Detail
    3. In Brief
  8. Designing GUI Applications with Windows Forms
    1. Investigating Unsupported Controls in the .NET Compact Framework
    2. Investigating Unsupported System.Windows.Forms Functionality in the .NET Compact Framework
    3. Working with the Visual Studio .NET Form Designer
    4. Understanding the Different Windows Forms Target Platforms
    5. Working with the Form Control
    6. Programming the Button Control
    7. Using the TextBox Control
    8. Using the Label Control
    9. Working with RadioButton Controls
    10. Using the CheckBox Control
    11. Using the ComboBox Control
    12. Using the ListBox Control
    13. Using the NumericUpDown Control
    14. Using the DomainUpDown Control
    15. Programming the ProgressBar Control
    16. Using the StatusBar Control
    17. Using the TrackBar Control
    18. Using the ToolBar Control
    19. Adding Menus with the MainMenu Control
    20. Using a ContextMenu Control in an Application
    21. Using the Timer Control
    22. Using the OpenFileDialog and SaveFileDialog Controls
    23. Using the Panel Control
    24. Using the HScrollBar and VScrollBar Controls
    25. Using the ImageList Control
    26. Using the PictureBox Control
    27. Using the ListView Control
    28. Using the TabControl Control
    29. Using the TreeView Control
    30. Working with the DataGrid Control
    31. In Brief
  9. Using Threads and Timers in the .NET Compact Framework
    1. Threads, Timers, and Windows CE
    2. The Thread Class
    3. Understanding Thread Basics
    4. Coordinating Threads with the Mutex Class
    5. Blocking until a Thread Finishes
    6. Controlling Access to Data Objects with the Monitor Class
    7. Managing Multiple Threads with a Thread Pool
    8. Timers
    9. Updating Variables with the Interlocked Class
    10. In Brief
  10. Network Connectivity with the .NET Compact Framework
    1. Working with Sockets
    2. Socket Programming with the .NET Compact Framework
    3. Serializing Objects for Transmission through a Socket
    4. Using UDP Packets
    5. Multicasting with UDP Packets
    6. Communicating with Remote Servers through the HTTP Protocol
    7. Communicating with Remote Servers through the HTTPS Protocol
    8. Communicating through the Device IrDA Port
    9. In Brief
  11. ADO.NET on the .NET Compact Framework
    1. Introducing ADO.NET on the .NET Compact Framework
    2. Caching Data with the DataSet
    3. Understanding Constraints
    4. Setting Up Autoincremented Fields
    5. Modeling Relational Data with the DataSet
    6. Creating Bindable Views of Data with a DataView
    7. Binding Data to a Control
    8. Comparing the Compact DataSet with the Desktop DataSet
    9. In Brief
  12. Programming with Microsoft SQL Server CE
    1. Investigating the Features Supported by Microsoft SQL Server 2000 Windows CE Edition
    2. Creating a Microsoft SQL Server CE Database
    3. Adding Structure to a Microsoft SQL Server CE Database
    4. Populating a Microsoft SQL Server CE Database
    5. Retrieving Data by Using SqlCeDataReader
    6. Filling a DataSet by Using the SqlCeDataAdapter
    7. Updating the Microsoft SQL Server CE Database by Using the SqlCeDataAdapter
    8. Generating SqlCommand Objects with the SqlCeCommandBuilder
    9. In Brief
  13. XML and the DataSet
    1. XML and the .NET Compact Framework DataSet
    2. Loading XML into a DataSet
    3. Saving a DataSet as XML
    4. Loading and Saving XML in a Sample Application
    5. Modeling Relational Data with XML Schemas
    6. Loading and Saving Schema Alone
    7. Writing a DataSet to XML without Schema Information
    8. Reading a DataSet from XML, Ignoring Schema Information
    9. Inferring Schema
    10. Using XML to Design a DataSet
    11. Saving and Loading DataSets as XML DiffGrams
    12. In Brief
  14. Using XML Web Services
    1. Creating a Simple XML Web Service
    2. Understanding the .NET Framework Web Service Client
    3. Creating a Client for the Simple XML Web Service
    4. Consuming a Web Service That Uses a DataSet
    5. Consuming Web Service That Exposes a Typed DataSet
    6. In Brief
  15. Manipulating XML with the XmlTextReader and the XmlTextWriter
    1. XML Architecture Overview
    2. Working with the XmlTextReader
    3. Loading XML Data into an XmlTextReader
    4. Using the XmlTextReader's Namespaces Property
    5. Understanding the Normalization Property
    6. Controlling White-Space Interpretation with the WhitespaceHandling Property
    7. Using the XmlResolver Property
    8. Reading XML Nodes
    9. Reading XML Attributes
    10. Understanding How to Perform Full-Content Reads
    11. Skipping over Nodes
    12. Closing the XmlTextReader
    13. Working with the XmlTextWriter
    14. Creating the XmlTextWriter
    15. Manipulating Namespace Support
    16. Formatting the XmlTextWriter's Output
    17. Writing an XML Declaration
    18. Writing XML Elements
    19. Writing XML Attributes
    20. Writing xml:space and xml:lang Attributes
    21. Writing Element and Attribute Content
    22. Converting .NET Compact Framework Data Types through XmlConvert
    23. Writing Raw XML Markup
    24. Writing Other Nodes
    25. Writing Processing Instructions
    26. Writing White-Space Characters
    27. In Brief
  16. Working with the XML Document Object Model
    1. Processing XML by Using the Document Object Model
    2. Differences from the Desktop .NET Framework
    3. Loading the XML DOM
    4. Navigating the XML DOM
    5. Accessing Text from Elements
    6. Accessing Markup from Nodes
    7. Accessing an Element's Attributes
    8. Accessing Other XmlNodes
    9. Searching an XML Document Node Tree
    10. Creating XmlNodes
    11. Creating XmlDeclarations
    12. Creating XmlElements
    13. Creating XmlAttributes
    14. Creating Other Node Types
    15. Inserting XmlNodes
    16. Using the AppendChild and PrependChild Methods
    17. Working with the InsertBefore and InsertAfter Methods
    18. Inserting XmlAttributes into an XmlDocument
    19. Replacing the XmlNodes within an XmlDocument
    20. Removing XmlNodes for an XmlDocument
    21. Removing XmlAttributes from their XmlElements
    22. Writing the XmlDocument
    23. In Brief
  17. Interacting with Native Code
    1. Understanding When to Call Native Code
    2. Calling Native Code: Quick Start
    3. Marshalling the Fundamental Data Types
    4. Marshalling Simple Structures
    5. Passing Nested Structures by Using Custom Marshalling Code
    6. Calling the Windows CE Operating System
    7. Accessing COM Components from the .NET Compact Framework
    8. In Brief
  18. Exploring .NET Reflection
    1. Understanding the .NET Compact Framework Reflection API
    2. Loading .NET Assemblies
    3. Discovering Type Information
    4. Creating Type Instances by Using ConstructorInfo
    5. Invoking Methods by Using the MethodInfo Class
    6. Using Reflection to Manipulate Object State
    7. Adding Custom Metadata to .NET Elements
    8. In Brief
  19. Cryptography
    1. Cryptography on the .NET Compact Framework
    2. Invoking the CryptoAPI
    3. Computing a Hash
    4. Encrypting and Decrypting Data by Using a Password
    5. Using Session Keys to Encrypt and Decrypt Data
    6. Determining CryptoAPI Constants with the ConstFinder Sample Application
    7. In Brief
  20. Measuring the Performance of a .NET Compact Framework Application
    1. Using a Stopwatch Timer to Measure Code Execution Time
    2. Using .NET Compact Framework Performance Counters
    3. In Brief
  21. Deploying a .NET Application
    1. Packaging a .NET Compact Framework Application
    2. Using Visual Studio .NET to Package an Application
    3. Using CAB Wizard to Package an Application
    4. Distributing a .NET Compact Framework Application
    5. In Brief
  22. Developing for the SmartPhone
    1. Introducing the SmartPhone
    2. Developing for the SmartPhone by Using the .NET Compact Framework
    3. Writing an Application for SmartPhone—XMLDataSetViewer
    4. In Brief