Tuesday, July 31, 2007

Clinic 5137: Introduction to Developing with Windows® Communication Foundation and Visual Studio® 2005

For those looking for some free WCF training, visit the Microsoft e-Learning site and take a look at Clinic 5137.

Description:

In this 2-hour premium clinic you will learn about Windows Communication Foundation, the next generation technology for developing service oriented applications. Within the clinic you will learn about WCF Architecture, how to create WCF Services and Clients, and enhancing WCF services with security and reliability.

This clinic will provide a starting point for Enterprise Developers and Software Architects that are looking to Windows Communication Foundation as a solution for their service oriented solutions.

Objectives:

At the end of the course, students will be able to:

  • Describe WCF as a technology
    • Explain What is WCF
    • Describe WCF Features for Developers of Service-Oriented Applications
  • Describe how to create WCF Services and Clients
    • Create a WCF Service
    • Create and Invoke a WCF Client
    • Customize WCF with Behaviors
  • Describe WCF Features
    • Use Bindings in WCF
    • Use WCF Security
    • Use Reliability in WCF Applications

Modules & Lessons:

  • Introduction to WCF
  • Overview of WCF
  • WCF Features for Developers of Service-Oriented Applications
  • Creating WCF Services and Clients
  • Module Introduction
  • Creating a WCF Service
  • Creating and Invoking a WCF Client
  • Customizing WCF with Behaviors
  • Exploring WCF Features
  • Bindings in WCF
  • Introduction to WCF Security
  • Reliability in WCF Applications

MSDN Webcast: Windows Communication Foundation Top to Bottom (Part 05 of 15) - Bindings

This series is being presented by Michele Leroux Bustamante (Chief Architect, IDesign Inc, Microsoft Regional Director for San Diego, MVP XML Web Services) and author of Learning WCF (O'Reilly, 2007) and touches on the fundamentals and practical approaches of WCF development.

This session covered:

  • What are bindings?
  • Standard Bindings
  • Custom Bindings

Key points from this session:

  • Bindings define the protocols and configure the communication channel
  • Standard Transport Protocols
    • HTTP Internet, punch-through Firewall and interoperability
    • TCP intranet or crossing machine boundaries
    • Named Pipes for services on same machine to protect from being accessed from another machines
    • MSMQ for one-way communication
  • A channel stack is built to send or receive messages
    • Client proxy is a channel built from the client-side binding configuration
    • ServiceHost exposes channel listeners for each endpoint based on service binding configuration
  • Bindings are made up of binding elements which configure a part of the channel stack
  • Bindings can be customised instead of using the default
  • Standard Bindings
    • Web Service Bindings
      • BasicHtpBinding – SOAP 1.1 compatibility
      • WSHttpBinding SOAP 1.2 with WS*
      • WSDualHttpBinding callbacks over HTTP with WS*
      • WSFederationHttpBinding federated security and single sign-on
    • Cross-Process / Machine Bindings
      • NetNamedPipeBinding for in-process or same-machine calls
      • NetTcpBinding for same-machine or cross-machine calls and richer security
      • NetPeerTcpBinding for same-machine or cross-machine peer-to-peer messaging
    • Messaging Bindings
      • NetMsmqBinding for reliable, transacted and persistent messaging over MSMQ
      • MsmqIntegrationBinding for MSMQ interoperability with earlier technologies
  • Standard bindings can be customised

The fifth webcast is available for download from here along with a copy of the Powerpoint deck. Webcast 6 (Hosting) has already been delivered (will blog about it tonight) meaning that the next Webcast (session 7) is scheduled for 10th August 2007 and is titled "Messaging Patterns". A schedule on the complete series can be found here.

Monday, July 30, 2007

WARDY IT Solutions - July SQL Server Newsletter

The July 2007 edition of the WARDY IT Solutions SQL Server Newsletter has been released and can be viewed at http://www.wardyit.com/newsletters/jun2007.htm.

In this issue we cover:

To subscribe to the newsletter send an email to newsletter_add@wardyit.com.

Wednesday, July 25, 2007

August WARDY IT Community Dinner

The WARDY IT Community Dinner is a great opportunity to share knowledge, information and experiences with other IT professionals in South East Queensland.

The August WARDY IT Community Dinner is being held a week later than usual on Monday the 20th of August to allow people to recover from Tech-Ed on the Gold Coast.

WHERE: James Street Bistro - 39 James Street, Fortitude Valley
WHEN: Monday 20th August @ 6:30PM
RSVP: Friday 17th August (peter @ wardyit.com)

Please note that you are responsible for the cost of your own dining.

Add this event to your Outlook Calendar

Tuesday, July 24, 2007

light.exe : error LGHT0216: This installation is forbidden by system policy

While practicing my Canberra VSTS presentation last night (1am) I experienced a presenters worse nightmare; Demo failure! For no apparent reason I started getting the following error while trying to compile WiX projects as part of the MSBuild process:

light.exe : error LGHT0216: An unexpected Win32 exception with error code 0x659 occurred: This installation is forbidden by system policy. Contact your system administrator

Paralised with panic I lauched Google, did a search on "LGHT0216" and nearly had a heart attack when I only got 7 hits. This is not good. I've got an error that hardly anyone else has experienced and I only have 30hrs to find a solution. Please let there be an answer in one of these hits!

The first hit had the same error code but a description of "An unexpected Win32 exception with error code 0x659 occurred: The system cannot open the device or file specified". Aarrgh. Generic error codes. A debuggers worse nightmare!

The second hit matched my error word-for-word but talked about using the "-sval" switch in Votive (WiX VS.NET IDE Compiler) to disable validation; something not recommended as the validation process validates your MSI. I quickly scrolled through the rest of the article and towards the bottom saw that Votive uses the Windows Installer Engine to do its validation and that if the Windows Installer Service is not running, validation will always fail.

Of course; makes sense. I should have read the error more closely! Pfft

So, my demo is once again running and I have set the Windows Installer Service to startup Automatically.

Monday, July 23, 2007

Canberra VSTS User Group Meeting - July 2007

I am presenting a session at the Canberra VSTS User Group this Wednesday (25th July 2007) on Continuous Integration using TFS, TFS Integrator, TFSAlert, MSBuild and WiX.

So what is Continuous Integration? According to Fowler (2006), "Continuous Integration is a software development practice where members of a team integrate their work frequently; usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible."

The session will provide attendees with one example of how to implement a Continuous Integration environment and draws upon experience gained supporting a CI environment at DITR.

Details of the event are as follows:

WHEN:
Wednesday 25th July - 8:00AM to 9:30AM

WHERE:
Microsoft Canberra
Level 2
44 Sydney Ave, Barton
Map: http://local.live.com/?v=2&sp=Point.93fcn8xdtnk1_Microsoft%20Canberra


REGISTRATION:
Registration is essential for catering! Please email grant@holliday.com.au

Prometric's Change of Heart for Tech.Ed Australia Certification

Looks like my emails, blog and post to the MCT Private Newsgroups may have got someone's attention as I had a call from MS this morning advising that after discussions with Prometric (I assume since Friday), some new options are available for certification testing at Tech.Ed Australia.

This is great news for candidates attending Tech.Ed Australia. Thanks Sharmilla (Partner Development Manager, Microsoft) :-D

Here are the options now available:

Option 1

Current arrangement for testing at 8am, 1pm and 4:30pm

Option 2

The candidate offers up a timeslot and Prometric will try and accommodate their request.

Option 3

Where Option 1 or Option 2 can't be accommodated, a voucher will be issued to the candidate allowing them to sit the exam at any Prometric Test Centre valid until 31st August 2007.

Friday, July 20, 2007

Certification @ Tech.Ed Australia 2007 - What a Fiasco

UPDATE: Please read this post for an update from Promectric and Microsoft.

It's only been 8 days since I blogged about Microsoft handing exclusive rights to Prometric to host certification exams and the ramifications of this decision are already hitting home hard.

Prometric are responsible for providing certification testing at Tech.Ed Australia this year and have implemented an exam schedule that can only be described as ludicrous, inflexible and totally inconvenient and will do nothing but result in complete chaos and disappointment for candidates.

Prometric has only allocated three slots on Wed/Thur (8am/1pm/4:30pm ) and 2 slots on Friday (8am/11:30am) for attendees to sit their exams with exams lasting more than 3 hours only being available at 8am on Wednesday and Thursday. They have also made registering for exams an absolute nightmare by not accepting bookings online and requiring candidates to make a booking when they get called by a Prometric representative (I had my call the other day and ended up requesting a refund as no slots were convenient for me).

When Person VUE provided this service last year (and the year before and at Tech.Ed US this year) candidates were emailed a voucher that could be used to book an exam online at a time of their choosing. This enabled candidates to do an exam at a time that fitted in with their Tech.Ed agenda; not an agenda set by the provider.

The sad thing is that I already know of 5 people who have canceled their exam due to the inflexible schedule put forward by Prometric. Wonder how many more canceled exams it will take for Microsoft and Prometric to wake up to themselves and change things!

Thursday, July 19, 2007

SQL Down Under Code Camp '07

SQL Down Under Code Camp is on again and scheduled for 13th/14th October 2007 @ Charles Sturt University Wagga Wagga.


This year promises to be better than ever and crammed full of great sessions, fun activities and top notch social events.

If you are planning to come, please email greg.low @ readify.net (to assist with catering numbers) and ensure you book ASAP as accommodation is likely to be limited this year. Security Camp Oz is also on at the same time and venue so we've kept the schedules identical to enable you to attend sessions from either camp.

Further details and schedule updates can be found at SQLDownUnder.

This is one camp you can't afford to miss!

Hope to see you there.

Uninstalling InstallShield Developer Corrupts Microsoft Visual Studio .NET

Pretty amazing how a company who specialises in developing package and deployment software could allow one of their own products to corrupt Microsoft Visual Studio .NET on uninstall.

InstallShield Developer is a popular tool used by many developers to package applications and it's popularity has grown since integration into the Visual Studio .NET IDE. Given that this software is used to build deployment packages, you'd think that uninstalling such a product would not affect any other products installed on a machine as this is a crucial requirement of creating proper installation packages Not so!

If you have installed and uninstalled a version of this product you may start getting the following error when trying to build packages using Visual Studio .NET Package and Deployment:

"An error occurred while validating. HRESULT='80040155'"

I found this out via an article on DotNet247 which referred me to an article on Macrovision Support (they bought out InstallShield last year). The official explanation of this error is:

"This behavior is due to a bug in the uninstallation of InstallShield Developer that unregisters a critical Visual Studio .NET file."

Interesting! The article goes on to say that "This issue has been resolved in Developer 7.04 and above". This bit I don't beleive as the only version I've installed/uninstalled on this machine was InstallShield X v10 and I'm getting the error.

So what's the workaround if you continue to get this error? Follow the steps in the Macrovision article or download the registry patch. It worked for me.

Wednesday, July 18, 2007

Update: Telstra NextG Turbo Card (Model MF332) and Vista

Please refer to post Telstra Turbo Card MF 332 Windows Vista and 7.2Mpbs Upgrades Released for latest updates for this card.

I was doing some traffic analysis on my blog last night and saw that a lot of people have been reading my post on Telstra NextG Turbo Card (Model MF332) and Vista. As this post was done back in January 2007, I decided to check whether Telstra or ZTE had released an updated driver. A quick look at the ZTE Support Site revealed things were the same and that B10 released on 18/12/2006 is the latest driver available.

Given that Vista was released some time ago, I decided to contact ZTE to ascertain when a Vista driver would be released. Here's the response I received from support:

Hi Jeff,

To advise updates for the Telstra Turbo Card Manager to work with Vista for the MF332 are not too far away. However, recently we were advised of a orkaround that should allow the 'Telstra Turbo Card Manager' to run on a PC with Vista installed. I have taken the liberty to attach a document that outlines how to install.

Please note, you will need to perform the following:

Uninstall the Telstra Turbo Card Manager software previously installed

  1. Uninstall the drivers loaded from previous attempts (from Device Manager)
  2. Please advise how you go with actioning this procedure & the overall result. regards,Support ZTE (Australia) Pty Ltd
Please advise how you go with actioning this procedure & the overall result. regards,

Support
ZTE (Australia) Pty Ltd

Ok. Some good news (potentially). Anyways, the PDF basically tells you to do what I said in my original post (i.e. just ignore the fact that it's Windows XP software and install it) except they have added steps to launch the installation in 'Windows XP (Service Pack 2) compatibility mode' and as an Administrator and then set the properties of the 'Telstra Turbo Card Manager shortcut icon' to also run in 'Windows XP (Service Pack 2) compatibility mode'. I haven't done any of this and my Turbo Card is still running fine.

Sunday, July 15, 2007

MSDN Webcast: Windows Communication Foundation Top to Bottom (Part 04 of 15) - Exceptions and Faults

Yay, I did it!. My brains fried but at least I've caught up and can get back to preparing for Tech.Ed and my VSTS, Canberra.NET, Canberra SQL Server and Brisbane SQL Server User Group presentations :S

This series is being presented by Michele Leroux Bustamante (Chief Architect, IDesign Inc, Microsoft Regional Director for San Diego, MVP XML Web Services) and author of Learning WCF (O'Reilly, 2007) and touches on the fundamentals and practical approaches of WCF development

This session covered:

  • Exception handling for WCF services
  • Propagating exception details to the client
  • Throwing and caching faults
  • Dealing with uncaught exceptions

Key points from this session:

  • CLR exceptions do not flow across service boundaries so must be serialized before reporting to clients (SOAP)
  • WCF automatically converts exceptions into SOAP faults.
  • Uncaught exceptions are returned as a general SOAP fault. The default is that the exception that was originally thrown is not shared with the client (security reasons). Need to opt-in (IncludeExceptionDetailsInFaults) to provide these details.
  • Uncaught exceptions fault the server channel and renders the client channel (proxy) useless (if sessions are involved). Should throw fault exceptions where possible.
  • Should consider declaring faults (FaultContractAttribute) and throwing these so that clients know what types of faults could be thrown. Also provides them with strongly-typed exceptions.
  • Can declare faults as part of WSDL
  • WCF supports centralised error handling
  • Provide an implementation for IErrorHandler
    • ProvideFault()
    • HandleError()
  • Error Handling Strategies:
    • Method 1
      • Simple Approach
        • Throw CLR exceptions from business/data layers
        • Catch exceptions at the service layer and convert to faults as appropriate
        • Record uncaught exceptions with handler
    • Method 2
      • Behind the Firewall
        • Throw CLR exceptions from business/data layers
        • Declare CLR exceptions as faults
        • Create error handler to convert known exceptions to faults automatically
        • Record uncaught exceptions
        • CONS - Not interoperable
    • Method 3
      • Interoperable Approach
        • Throw custom CLR exceptions from business/data layers
        • Define exceptions as data contracts
        • Declare custom exception types as faults
        • Create error handler to convert custom exceptions to faults
        • Record non-custom exceptions
        • CONS - Requires well-defined error handling strategy

The fourth webcast is available for download from here along with a copy of the Powerpoint deck. The next Webcast is scheduled for 23rd July 2007. A schedule on the complete series can be found here.

MSDN Webcast: Windows Communication Foundation Top to Bottom (Part 03 of 15) - Contract Versioning

This series is being presented by Michele Leroux Bustamante (Chief Architect, IDesign Inc, Microsoft Regional Director for San Diego, MVP XML Web Services) and author of Learning WCF (O'Reilly, 2007) and touches on the fundamentals and practical approaches of WCF development

This session covered:

  • Versioning scenarios for WCF services
  • Strict vs. non-strict approaches to versioning
  • Data contract versioning and impact on downstream business entities
  • When to version service contracts and associated endpoints
  • Ensuring backward compatibility

which was perfect timing for me as we're currently starting work on v1.1 of our application and may need to change some of our contracts.

Some key points from this session:

  • Clients and services must agree on contracts and policy
  • WCF supports WS-Policy
  • Once WSDL contract is published, it's final (i.e. must support backward compatibility)
  • WCF is version tolerant (within reason) by default (i.e. forgives extra and missing data by default)
  • IExtensibleDataObject preserves unknown elements during serialization of data contracts (recommended for client proxy but not server due to potential DoS attacks)
  • Client proxy implements IExtensibleDataObject by default to handle server sending additional data not in original contract
  • IExtensibleDataObject can be disabled by using [ServiceBehaviour(IgnoreExtensionDataObject=true)]
  • Versioning guidelines
    • Service Contracts
      • Non-strict (diagram)
        • Add new methods to existing contract
        • Same namespace
        • New clients get latest
      • Semi-strict (diagram)
        • Add new methods to a new contract with a new namespace
        • Inherit old contract
        • Expose new contract at original endpoint or expose new contract at NEW endpoint to trackusage
      • Strict (diagram)
        • Create a new contract with a new namespace for all operations
        • No inheritance
        • Create a seperate service and endpoint
        • Share common functionality with a base service type
    • Data Contracts
      • Non-Strict (diagram)
        • Never remove required members
        • Add new non-required members
        • No changes to namespace
      • Strict (diagram)
        • Update business objects as needed for business and data tier (preserve type name)
        • Version data contract namespace
        • Version the service contract
        • For v1.0 clents
          • Create acopy of old business object (new type name) with original data contract namespace
          • Preserve v1.0 service endpoints
          • Map to v2.0 before calling business tier

The third webcast is available for download from here along with a copy of the Powerpoint deck. Webcasts 4 has already been delivered (will blog about it tonight) meaning that the next Webcast (session 5) is scheduled for 23rd July 2007. A schedule on the complete series can be found here.

MSDN Webcast: Windows Communication Foundation Top to Bottom (Part 02 of 15) - Contracts

Finally got around to watching the second instalment of "Windows Communication Foundation Top to Bottom". Still have two more to go to catch up and desperately trying not to fall into my usual routine of downloading these things and then never watching them. Have tried watching them live but getting up at 2am is insane; no matter how good they may be!

This series is being presented by Michele Leroux Bustamante (Chief Architect, IDesign Inc, Microsoft Regional Director for San Diego, MVP XML Web Services) and author of Learning WCF (O'Reilly, 2007) and touches on the fundamentals and practical approaches of WCF development.

This session covered:

  • How to design service contracts for your WCF services
  • Handling complex type serialization
  • Working with service contracts, data contracts, and message contracts
  • Code-first versus contract-first approaches.
but mainly concentrated on WSDL and Serialization.

The second webcast is available for download from here along with a copy of the Powerpoint deck. Webcasts 3 and 4 have already been delivered (will blog about them tonight) meaning that the next Webcast (session 5) is scheduled for 23rd July 2007. A schedule on the complete series can be found here.

Friday, July 13, 2007

Book Review: Microsoft SQL Server 2005 Compact Edition

Just finished reading what I beleive is currently the only book dedicated to Microsoft SQL Server 2005 Compact Edition (SSCE).

The book is authoured by Prashant Dhingra and Trent Swanson and provides a good overview of SSCE; although I did find quite a bit of repetative content, especially in the introduction and first 2 chapters. There are heaps of exercises and code examples to assist both the novice and experienced SSCE developer/administrator and covers everything you'll need to know to get your first application synchronising with SQL Server 2005.

The book is published by SAMS (ISBN: 9780672329227) and currently sells for about US$37.79 at Amazon.

Chapter Summary

Introduction and Chapters 1 (Getting Started with SQL Server 2005 Compact Edition) and 2 (Platform Support and Installation)

These chapters could have been combined into one as there was a lot of repeated material about the history and versions of SSCE and how each version gets installed and what the differences and features are compared to SQL Server 2005 and SQL Server 2005 Express editions.

Chapter 2 provides a good summary of the names of each Dll used in SSCE 3.x as well as the following diagram showing where each is deployed.


Microsoft SQL Server 2005 Compact Edition Deployment Architecture.


Chapter 3 - Getting to Know the Tools

Provides a brief overview of how to use tools such as SQL Server Management Studio, Query Analyzer and Visual Studio to create, connect to, administer and deploy SSCE databases. No need to elaborate as nothing new here, however read it if you are new to SQL Server or Visual Studio!

Chapter 4 - Managing the SQL Server 2005 Compact Edition Database

This is where we started to get into the nuts and bolts of SSCE; although it was still a bit of an overview chapter. This chapter dealt with Creating, Deleting, Verifying, Repairing, Compacting, Shrinking, Securing, Backing up and Restoring databases using the tools explained in Chapter 2. Code examples are in VB.NET and C# which is good as I code in both which makes it easy to teach others how to use the technology. Key point

  • SSCE is a file based system made up of a single file consisting of logical pages.

Chapter 5 - Defining Database Structure

Provides an introduction to creating, updating and dropping SSCE objects (Tables, Columns and Indexes), and using Templates and Metadata. If you already know how to do this stuff you can probably skip this chapter as there's nothing new here except the following two key points:

  • Each table can have a maximum size of 512MB containing a maximum of 1024 columns and 249 constraints
  • SSCE supports 17 Uicode data types
    • .NET mappings
    • SQL Server 2005 mappings

Chapter 6 - Manipulating the database

Introduces the syntax of common SQL statements and how to execute them. Key points:

  • Add a reference to the System.Data.SqlServerCE namespace and use the SqlCeConnection object to make a connection using ADO.NET
  • SSCE allows you to specify a Temporary DB in the connection string used for storing interim results during query execution and while executing SORT BY, ORDER BY and GROUP BY clauses.
  • SSCE 3.x provides Multiuser access features by allowing multiple connections. This enables scenarios such as data synchronisation in the background while a client application is accessing data. SSCE 3.x allows 256 connections.
  • SSCE uses Row, Table, Page and Database locks. By default it uses row-level for data pages and page-level for index pages.
  • SSCE automatically locks rows and corresponding index pages when modifying. This will escalate to a table lock based on the number of locks being used by an application.
  • Row identifier is used to lock a single row in a table.
  • SSCE uses Shared, Update, Exclusive, Schema and Intent locks
  • You can set the Mode property of the connection string to provide Read Write, Read Only, Exclusive and Shared Read for that connection.
    • SqlCeConnection myConn = new SqlCeConnection(“DataSource=\\ MyPatients.sdf; temp path=\\ MyPatients2.sdf; Mode=’ Exclusive’;”);
  • SSCE supports Serializable, Repeatable Read and Read Committed isolation levels. Does not support Read Uncommitted.

Chapter 7 - Programming SQL Server 2005 Compact Edition with ADO.NET

Covers how to use ADO.NET to connect to the SSCE database as well as how to read, update, and merge the changes back to the SSCE database and provides a fundamental understanding of ADO.NET objects for SSCE. Key points:

  • The System.Data.SqlClient classes in the .NET Compact Framework match with the classes in the .NET Framework except for the following limitations:
    • Connection pooling is not supported
    • Distributed transactions are not supported
    • Encrypted connections to SQL Server are not supported
    • Connection string properties related to connection pooling, encryption, network library, and so on are not supported
    • The use of SQL Server authentication to connet to SQL Server from smart devices is not supported
    • SqlClientPermission and SqlClientPermissionAttribute classes are not supported
  • The connection to the database does not close if the SqlCeConnection object goes out of scope so you must explicitly close it.
  • To specify the Temporary DB for a connection, you must provide the temp file directory and temp file max size properties in the connection string
  • SqlCeResultSet
    • provides an updateable scrollable cursor and is only available to SSCE i.e no corresponding class for the SQL Server DB
    • derives from SqlCeDataReader to provide the performance of a Data Reader and functionality similar to a DataSet.
    • uses less memory as it does not perform double buffering of the database as a DataSet does. This is because a SSCE DB is already in memory so there is no need to buffer data in memory.
  • SqlCeTransaction - Must explicitly Commit or Roll back a transaction

Chapter 8 - Introducing Native Access

Discusses how to use unmanaged code (non .NET) with SSCE. Didn’t read this chapter as not interested in developing using unmanaged code; besdies, it looked very confusing!

Chapter 9 - Using Operators in SQL Server 2005 Compact Edition

This chapter provides the syntax and examples of each operator that the SSCE database supports. Nothing new here, however read it if you are new to SQL Server. Key point:

  • SSCE supports most of the operators supported by SQL Server:
    • Arithmetic
    • Assignment
    • Bitwise
    • Comparison
    • Logical
    • String
    • Unary

Chapter 10 - Using the Built-In Functions

Provides an overview of the built-in functions supported by SSCE. Key points:

  • SSCE supports a subset of the built-in functions SQL Server 2005 supports:
    • Mathematical functions - ABS, ACOS, ASIN, ATAN, ATN2, CEILING, COS, COT, DEGREES, EXP, FLOOR, LOG, LOG10, PI, POWER, RADIANS, RAND, ROUND, SIGN, SIN, SQRT, TAN
    • Aggregate Functions - AVG, COUNT, MAX, MIN, SUM
    • String Functions - NCHAR, CHARINDEX, LEN, LOWER, LTRIM, PATINDEX, REPLACE, REPLICATE, RTRIM, SPACE, STR, STUFF, SUBSTRING, UNICODE, UPPER
    • DateTime Functions - DATEADD, DATEDIFF, DATEPART, DATENAME, GETDATE
    • System Functions - @@IDENTITY, COALESCE, DATALENGTH
    • Others - CASE, CONVERT, NEWID

Chapter 11 - Upgrading from a Previous Version

Discusses how to upgrade a 1.0, 1.1 or 2.0 SSCE database to SSCE 2005, Visual Studio 2003 projects to Visual Studio 2005 and .NET Compact Fromework 1.0 projects to .NET Compact Framework 2.0. SSCE upgarde Key points:

  • SSCE 3.x replaces Microsoft SQL Server 2000 Windows CE Edition (SQL Server CE 2.0)
  • No need to upgrade a SQL Server 2005 Mobile Edition 3.0 DB as this file format is compatible with 3.1
  • There are a few ways to migrate to SSCE 3.1:
    • If all data is synchronised using replication or remote data access, you can simply migrate using the replication technologies.
      • Set up a Replication between the new SSCE 3.1 DB and the earlier SQL Server 2000 DB
      • Upgrade SQL Server 2000 to SQL Server 2005 and set up a Merge Replication (covered in Chapter 12) or RDA (covered in Chapter 13) between the SSCE 3.x database and the SQL Server 2005 DB (covered in Chapter 12).
      • Update application replication InternetURL property so that it points to the SSCE Server Agent (sqlcesa30.dll)
  • If you need to migrate local data, you can:
    • roll your own upgrade library or tool (not covered in this book), or
    • leverage the command-line upgrade tool (upgrade.exe) available in SQL Server Compact. This option requires both DB engines to be installed on the device (or device emulator).
        • Database Upgrade Tool Prerequisites
        • Must perform the upgrade on the device.
        • SSCE 2.0, 1.1, or 1.0 must be installed on the device.
        • SQL Server Compact OLE DB Provider must be installed and registered.
        • SSCE must be installed on the device.
      • Options for Running Command Line Applications on Windows Mobile Devices
        • Visual Studio 2005: Device Command Shell found on gotdotnet.
        • Windows Mobile Developer Power Toys.
        • Write your own application to call the upgrade utility.
        • Open the command prompt window on supported devices.
      • The upgrade program only upgrades schema and data of an older version of SQL CE. It does not upgrade a subscription or RDA tracking information. If the SQL Server CE database has subscriptions or tracked tables, you should upload your changes before doing the upgrade.
      • The upgrade utility creates another database and uses approximately 300 KB of memory in the process of creating it. Make sure that you have enough storage for the source and destination database.

Chapter 12 - Synchronizing Data with Merge Replication

Discusses the architecture of Merge Replication and demonstrates how to use Merge Replication to transfer data from SQL Server to SSCE. Key points:

  • SQL Server provides various methods of replication; however, Merge Replication is the only method used between SQL Server and SSCE.
  • In Merge Replication terminology the server database is called Publisher and the client database is called Subscriber
  • A SSCE Subscriber can subscribe data from multiple Publishers.
  • Three main ways to transfer data:
    • Data downloaded only at regular intervals and used for browsing
    • Data created in SSCE and uploaded at regular intervals
    • Data downloaded and updated to/from SSCE at regular intervals with updates occurring on both SQL Server ad SSCE and
  • Replication makes it possible to synchronise some schema changes to SSCE.
  • Although a SQL Server Publisher can publish other objects such as stored procedures, views, functions; these are ignored by SSCE as they are not supported.
  • Compression can be used to reduce the amount of data transferred.
  • Encryption can be used while transferring data between the device and Web Server by using SSL.
  • SSCE provides settings, such as the timeout property, which enable you to obtain better GPRS connectivity.
  • The snapshot folder should be setup as a Network share as local paths are not accessible from agents running on the Subscriber.

Chapter 13 - Synchronizing Data with Remote Data Access

Discusses the use of Remote Data Access (RDA) to pull data from SQL Server into SSCE and how to push changes back to SQL Server. Key points:

  • RDA uses the IIS Web Server to transfer data from the client db to the server db.
  • Changes pushed to the backend db will overwrite any changes in the db, regardless of whether there are newer changes already on the server. This is why Merge replication is better for multiple update scenarios.
  • Pull method is used to get a table from a SQL Server and will create a table and indexes in SSCE and then fetch the data.
  • Data Type Conversions issues to consider
    • The data types that are supported in both databases can be pulled directly.
    • The data type is not supported in SSCE but is a compatible data type. At the time of the pull data, it is converted from SQL Server data type to SSCE data type.
    • The data types in SQL Server are incompatible with SSCE data types. These data types cannot be used for RDA pull.
  • You can switch on Change Tracking by passing a parameter to the Pull method. This will cause SSCE to track changes so they can be uploaded.
  • Restrictions on Tracking
    • The resultset produced by SELECT statement must be updatable.
    • Primary Key must be defined on updatable resocrdset returned by SELECT statement used in Pull method.
    • Multi Table Query can’t be tracked. You will receive an error at runtime if SELECT statement, View, or stored procedure refers to multiple tables.
  • Push method is used to send changes back to SQL Server. Need to switch on Track Changes to use this method.
  • By default the Push method sends changes one-by-one. You can use the batch feature to send all changes as a transaction. The Push operation will fail if a single row is not applied successfully.
  • SubmitSQL method can be used to execute a SQL Statement on the SQL Server. Can only be used with statements that do not return rows.
  • An error table in SSCE is used to log any errors that occur during RDA
  • Restriction on changing the Pulled table in SSCE:
    • You can’t remove the Primary key from the table that you fetched using RDA Pull.
    • You can’t add columns on a pulled table.
    • You can’t rename a column on a pulled table.
    • You can’t delete a column from a pulled table.
    • You can’t rename the table that you fetched using RDA Pull.
  • Restrictions in RDA
    • The Pull method gives an error if the recordset returned by the SELECT statement contains a computer column. You should exclude the computed column in the SELECT statement that pull data from the backend SQL Server.
    • SSCE can have 1024 columns in a table. Tracked RDA tables require 7 system columns. You can have up to 1017 columns in a tracked RDA table.
    • SQL Server 2005 supports Triggers on a table. SSCE does not support Triggers in a table. If you pull a table from SQL Server 2005 that has triggers, triggers will not be pulled into SSCE. However Triggers will be executed when you push changes back to SQL Server 2005.
    • If the pulled table contains an identity column, the management of identity columns should be done by your application. By default SSCE assigns the value of the identity seed and identity increment value to 1. To manage the Identity column you should use ALTER TABLE to change the identity seed and identiy increment value.
    • If you have set up Replication in SQL Server 2005 table, a rowguid column is added on Published tables. This column is not required in a local table on SSCE.
    • SQL Server 2005 is a case sensitive database. SSCE is a case insensitive database.
    • SSCE supports only a subset of data types supported by SQL Server. You should consider the guidelines given in the Data Conversion section.

Chapter 14 - Securing the SQL Server 2005 Compact Edition Database

Explains the SSCE features that you can use to address security issues and discusses the factors you should consider while planning to secure data for mobile workers. Key points:

  • DB password can be up to 40 characters long and contain alphabet, digit and nonalphanumeric characters.
  • Encryption needs to be used to stop a user from opening the DB file in clear text and gaining access to the content. A password alone will not prevent this.
  • A password is required to encrypt and decrypt a DB. If this password is lost you will never be able to decrypt the DB.
  • Should use SSL to encrypt the data between the client and the IIS Web Server
  • Recommended Practices
    • Basic authentication with SSL on a Web Server and SQL Server authentication on an SQL Server are the most suitable for an Internet-based application.
    • When you synchronize using Replication or RDA, the Server Agent allocates a worker thread pool consisting of worker threads. The thread pool is created per virtual directory. Having a separate virtual directory means a separate thread pool per application.
    • You should create an NTFS content folder for each virtual directory. The content folder contains a copy of the Server Agent dll as well as input and output files for data transfer.
    • Remove the default password and any unnecessary accounts.
    • Use an encryption method such as SSL to ensure secure data transfer over a network.
    • Remove access to an Internet Guest Account from the SQL Server if you are not using Anonymous access at the Web Server.
    • The Replication Merge Agent and Distribution Agent should be in a PAL (Publication Access List).
    • The Merge and Distribution Agent should have read access on a snapshot share.
    • Snapshot Agent should have write access on a snapshot share.

Chapter 15 - SQL Server 2005 Compact Edition Performance Tuning

Discusses tips you can use to increase the performance of the SSCE database and obtain faster synchronization. Key points:

  • SSCE uses a cost-based Query Optimizer i.e. it tries to estimate the cost of various query plans to determine the best query to execute.
  • SSCE Query Optimizer does not support query hints
  • SQL Server Compact edition does not support the SHOWPLAN_ALL, SHOWPLAN_TEXT, SHOWPLAN_ XML options.
  • Although it is possible to create multiple indexes on a table, the SQL Server Compact Edition Query Processor will consider all indexes but select only one index in the execution plan.
  • SSCE supports two types of hints
    • Table Hint
    • Query Hint
  • Use a forward-only cursor on Mobile devices where possible - SqlCeDataReader
  • Minimise the use of the DataSet. Use SqlCeResultSet instead
  • Synchronization Considerations
    • Avoid using text columns in a publication
    • Use the Download Only Articles feature if you are just synchronizing Lookup data
    • Avoid using complex joins

Thursday, July 12, 2007

Tech.Ed Australia 2007 – ILL Duties

I have now received confirmation of what Instructor-Led Labs (ILL’s) I’ll be presenting at Tech.Ed Australia 2007. I have also been advised that my Technical Learning Guide (TLG) role will revolve around supporting other ILL sessions; thus I won’t officially be working in the Hands-on-Labs (HOL’s) area (I say officially as I will still do a few hours there to catch up with friends and lend a hand when it gets busy).

The labs I will be presenting are “BIN01ILL - Using Report Builder in Microsoft SQL Server 2005” and “SOA20ILL - Microsoft Windows Communication Foundation Introductory Lab” which are both great labs so I hope to see you there.

Here is a brief overview of these labs.

BIN01ILL - Using Report Builder in Microsoft SQL Server 2005

Objectives

This lab uses SQL Server 2005 and Report Builder (part of Reporting Services 2005)

After completing this lab, you will be able to:

  • Auto-generate a Report Model in Model Designer
  • Refine the model using model item properties
  • Understand how model item properties affect end user reporting

Scenario

Adventure Works, the bicycle sales company you work for, wants to roll out end user reporting to its employees using Reporting Services’ features: Model Designer and Report Builder. You have been tasked with defining the report model these business users will interact with when building their ad hoc reports. Your data is already in a SQL Server database called Adventure Works, and you have Model Designer and Report Builder installed and ready to be tested. Your task is to build the report model and refine it so that your end users can use it.

Prerequisites

None.


SOA20ILL - Microsoft Windows Communication Foundation Introductory Lab

Objective

This lab introduces you to Windows Communication Foundation (WCF) and how you can use it for messaging and other distributed communications in a .NET Framework application. This lab uses Microsoft Visual Studio 2005 and the .NET Framework 3.0.

After completing this lab you will be able to:

  • Construct a simple Windows Communication Foundation Service
  • Host the service in a .NET executable
  • Host the service in IIS
  • Secured the service
  • Consume the service from a client

Scenario

In exercise 1 you will define and implement the contract for a Windows Communication Foundation service. That service will calculate the value of derivatives.

In exercise 2 you will host the Derivatives Calculator Service that you defined and implemented in the first exercise. Specifically, you will host the service within a .NET console application.

In exercise 3 you will build a client that will use the Derivatives Calculator Service that you constructed in the previous two exercises.

In exercise 4 you will host the Derivatives Calculator Service that you previously hosted within a .NET executable within IIS instead.

In exercise 5 you will prove to yourself that communications with the Derivatives Calculator Service are not being kept confidential, and you will modify the binding for the service so that communications with the service are kept confidential.

Prerequisites

Six months of .NET Framework development experience

Some People Will do Anything for a Ride in a Snow Ambulance!

A good friend of mine (Laird Carmichael) thought he was invincible on a recent trip to the Jindabyne snow fields and decided to ride a Ski Tube at 300kmh down the icy slopes in an attempt to impress his wife and kids.


Unfortunately all the years of heavy drinking at Tech.Ed has slowed the old reflexes and blurred his judgment to the point that he lost control and crashed into the barriers. The outcome was a free ride in a very nice snow ambulance and lots of love and care from his family.

Seriously though, get better soon dude as the gang wants you all fixed up ready for Tech.Ed 2007 Australia.

Cheers.
Jeff

P.S. Laird, perhaps you'll now be a little more timely with notifying your friends of such events :-D

Has Lutz Gone Loopy?

There has been a lot of discussion (anger) on the MCT private newsgroups and on various blogs (<