I'm looking for a piece of code written in VB.Net (VS 2010) capable of connecting to a CRM 2011 to pull data from Accounts, Contacts and a Custom Entity (about 10 fields, one of them is related to Accounts, there are a couple of pick-lists and a couple of Money fields).
This code will be part of an existing Windows DotNet application (written in VB.Net).
Once the data is pulled from CRM it should be stored in dataset which is the datasource of a datagrid within the existing application.
The code should also handle updates back to CRM. For example if data is modified within the Windows application, the changes should be reflected in CRM.
The code should also handle the authentication to CRM On-Line as well as On-Premise.
I'm interested only in code that handles the CRM connection and data manipulation, not the actual application interface.
All the code should be provided as text, not compiled.