<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>VB</title>
        <link>http://onteorasoftware.com/category/31.aspx</link>
        <description>VB</description>
        <language>en-US</language>
        <copyright>Ken Tucker</copyright>
        <generator>Subtext Version 2.1.2.2</generator>
        <item>
            <title>Getting Windows Mobile Device ID</title>
            <link>http://blog.onteorasoftware.net/archive/2009/03/26/getting-windows-mobile-device-id.aspx</link>
            <description>&lt;p&gt;I got email today asking me how to get the device ID from a pocket pc with vb&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:d68b95e0-d5cc-407c-a09e-7f21cae8703b" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: vb; gutter: false; first-line: 1; tab-size: 4;  toolbar: true; "&gt;Imports System.Text

Public Class Form1

    &amp;lt;System.Runtime.InteropServices.DllImport("coredll.dll")&amp;gt; _
Private Shared Function GetDeviceUniqueID(ByVal appdata As Byte(), ByVal cbApplictionData As Integer, ByVal dwDeviceIDVersion As Integer, ByVal deviceIDOuput As Byte(), ByRef pcbDeviceIDOutput As Integer) As Integer
    End Function

    Private Function GetDeviceId(ByVal appData As String) As Byte()

        Dim appDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(appData)
        Dim outputSize As Integer = 20
        Dim output(19) As Byte

        Dim result As Integer = GetDeviceUniqueID(appDataBytes, appDataBytes.Length, 1, output, outputSize)

        Return output

    End Function

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sbId As New StringBuilder

        Dim bID() As Byte = GetDeviceId("MyAppName")

        For Each b In bID
            sbId.Append(String.Format("{0:x2}", b))
        Next

        Debug.WriteLine(sbId.ToString)
    End Sub
End Class
&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;References&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a title="http://www.peterfoot.net/GetDeviceUniqueIDForVB.aspx" href="http://www.peterfoot.net/GetDeviceUniqueIDForVB.aspx"&gt;http://www.peterfoot.net/GetDeviceUniqueIDForVB.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/ms893522.aspx" href="http://msdn.microsoft.com/en-us/library/ms893522.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms893522.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blog.onteorasoftware.net/aggbug/2.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2009/03/26/getting-windows-mobile-device-id.aspx</guid>
            <pubDate>Thu, 26 Mar 2009 19:10:32 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/2.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2009/03/26/getting-windows-mobile-device-id.aspx#feedback</comments>
            <slash:comments>56</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/2.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Making a REST service with VB and WCF</title>
            <link>http://blog.onteorasoftware.net/archive/2009/03/24/making-a-rest-service-with-vb-and-wcf.aspx</link>
            <description>&lt;p&gt;REST which stands for Representational State Transfer is a way of sending data over the Internet without an additional message layer.  Standard web services use soap for there message header.  In this example we will create a service that uses the northwind database to send a  list of the products for a category.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Lets start by create a new VB web application. In that web application add a Ado.Net Entities data model.  In that class add the northwind database's product class.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.onteorasoftware.com/image.axd?picture=WindowsLiveWriter/MakingaRESTservicewithVBandWCF_13585/image_2.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.onteorasoftware.com/image.axd?picture=WindowsLiveWriter/MakingaRESTservicewithVBandWCF_13585/image_thumb.png" width="241" height="298" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Now add a service named Service1 to the web application.  Lets start by modify the web.config for the service to support rest.  First remove the ServiceBehavior section and add a endpointBehaviors section for webHttp.  In the endpoint we have to change the binding to webHttpBinding and the behaviorConfiguration to the webBehavior we created.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:f1ecc7b2-3c7f-4626-87c5-0a45bdfc5dfc" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: plain; gutter: false; first-line: 1; tab-size: 4;  toolbar: true; "&gt;    &amp;lt;system.serviceModel&amp;gt;
        &amp;lt;behaviors&amp;gt;
      &amp;lt;endpointBehaviors&amp;gt;
        &amp;lt;behavior name="webBehavior"&amp;gt;
          &amp;lt;webHttp/&amp;gt;
        &amp;lt;/behavior&amp;gt;
      &amp;lt;/endpointBehaviors&amp;gt;
        &amp;lt;/behaviors&amp;gt;
        &amp;lt;serviceHostingEnvironment aspNetCompatibilityEnabled="True"&amp;gt;&amp;lt;/serviceHostingEnvironment&amp;gt;
        &amp;lt;services&amp;gt;
            &amp;lt;service name="RestTest.Service1"&amp;gt;
                &amp;lt;endpoint address="" behaviorConfiguration="webBehavior" binding="webHttpBinding" bindingConfiguration="" contract="RestTest.IService1"&amp;gt;
                &amp;lt;/endpoint&amp;gt;
            &amp;lt;/service&amp;gt;
        &amp;lt;/services&amp;gt;
    &amp;lt;/system.serviceModel&amp;gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;When we added the service we got 2 items the wcf service and an interface for the service.  Before we go any further we need to add a reference to system.servicebehavior.web   &lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;In the Interface we need to define the how the categoryId is passed to the service.  In this example it expects product/categoryID in the url for the service &lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:d346bc95-1ff3-4d84-a205-ba8c3bff4f3a" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: vb; gutter: false; first-line: 1; tab-size: 4;  toolbar: true; "&gt;Imports System.ServiceModel
Imports System.ServiceModel.Web 

&amp;lt;ServiceContract()&amp;gt; _
Public Interface IService1 

    &amp;lt;OperationContract()&amp;gt; _
    &amp;lt;WebGet(UriTemplate:="Product/{categoryID}", ResponseFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)&amp;gt; _
    Function GetProducts(ByVal categoryId As String) As List(Of Products) 

End Interface 
&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;In the service we need to set the AspNetCompatibilityMode and write some code to return the products &lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:9a6af4a4-066b-4d03-b89d-75fe817632f1" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: vb; gutter: false; first-line: 1; tab-size: 4;  toolbar: true; "&gt;Imports System.ServiceModel.Activation 

&amp;lt;AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)&amp;gt; _
Public Class Service1
    Implements IService1 

    Public Function GetProducts(ByVal categoryId As String) As System.Collections.Generic.List(Of Products) Implements IService1.GetProducts
        Dim dc As New NorthwindEntities
        Dim q = From p In dc.Products Select p Where p.CategoryID = CInt(categoryId)
        Return q.ToList
    End Function
End Class 
&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;To call the service you would use a url like &lt;a title="http://localhost:2050/Service1.svc/Product/7" href="http://localhost:2050/Service1.svc/Product/7"&gt;http://localhost:2050/Service1.svc/Product/7&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;you will get an xml file like this returned &lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;a href="http://www.onteorasoftware.com/image.axd?picture=WindowsLiveWriter/MakingaRESTservicewithVBandWCF_13585/image_4.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.onteorasoftware.com/image.axd?picture=WindowsLiveWriter/MakingaRESTservicewithVBandWCF_13585/image_thumb_1.png" width="644" height="270" /&gt;&lt;/a&gt;&lt;img src="http://blog.onteorasoftware.net/aggbug/8.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2009/03/24/making-a-rest-service-with-vb-and-wcf.aspx</guid>
            <pubDate>Tue, 24 Mar 2009 20:25:51 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/8.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2009/03/24/making-a-rest-service-with-vb-and-wcf.aspx#feedback</comments>
            <slash:comments>33</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/8.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Publishing a VB Silverlight 2 Beta 2 app which uses a WCF service</title>
            <link>http://blog.onteorasoftware.net/archive/2009/02/15/publishing-a-vb-silverlight-2-beta-2-app-which-uses.aspx</link>
            <description>&lt;p&gt;
Note this works with the released version of Silverlight 2 
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
I created a Silverlight 2 beta 2 app which uses a WCF Silverlight service which worked fine localy but did call the service when I published it to my web host.  After playing around with the different settings I finally came across an entry in the Silverlight Forums by sladapter with a solution.  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://silverlight.net/forums/t/19021.aspx" title="http://silverlight.net/forums/t/19021.aspx"&gt;http://silverlight.net/forums/t/19021.aspx&lt;/a&gt;  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
So lets create a simple Silverlight 2 App to demo how to do this.  I created a silverlight app with a web application project.   I prefer web applications to web sites but a web site will work the same.   
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Add a WCF Silverlight- enabled service named  service1 to the web application.  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
This is the code I am using for the service
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Imports System.ServiceModel&lt;br /&gt;
Imports System.ServiceModel.Activation  
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ServiceContract(Namespace:="")&amp;gt; _&lt;br /&gt;
&amp;lt;AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)&amp;gt; _&lt;br /&gt;
Public Class Service1  
&lt;/p&gt;
&lt;p&gt;
    &amp;lt;OperationContract()&amp;gt; _&lt;br /&gt;
    Public Function SayHello() As String&lt;br /&gt;
        ' Add your operation implementation here&lt;br /&gt;
        Return "Hello World"&lt;br /&gt;
    End Function&lt;br /&gt;
End Class  
&lt;/p&gt;
&lt;p&gt;
  
&lt;/p&gt;
&lt;p&gt;
Lets add a TextBlock to the Page.xaml to display our message.  
&lt;/p&gt;
&lt;p&gt;
  
&lt;/p&gt;
&lt;p&gt;
&amp;lt;UserControl x:Class="SilverlightApplication2.Page"&lt;br /&gt;
    xmlns="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/a&gt;&lt;br /&gt;
    xmlns:x="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;"&gt;http://schemas.microsoft.com/winfx/2006/xaml"&lt;/a&gt;&lt;br /&gt;
    Width="400" Height="300"&amp;gt;&lt;br /&gt;
    &amp;lt;Grid x:Name="LayoutRoot" Background="White"&amp;gt;&lt;br /&gt;
            &amp;lt;TextBlock x:Name="txt"&amp;gt;Loading..&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;
    &amp;lt;/Grid&amp;gt;&lt;br /&gt;
&amp;lt;/UserControl&amp;gt;  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Now run the app.  Once that is done we can add a service reference to our silverlight app.  Press the arrow on the Discover button and select services in the solution.  You should windup with something like this.
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="/image.axd?picture=WindowsLiveWriter/PublishingaVBSilverlight2Beta2appwhichus_117FE/image_2.png"&gt;&lt;img style="border-width: 0px" src="/image.axd?picture=WindowsLiveWriter/PublishingaVBSilverlight2Beta2appwhichus_117FE/image_thumb.png" border="0" alt="image" width="401" height="336" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
In the silverlight app open up the file ServiceReferences.ClientConfig 
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;
        &amp;lt;bindings&amp;gt;&lt;br /&gt;
            &amp;lt;basicHttpBinding&amp;gt;&lt;br /&gt;
                &amp;lt;binding name="BasicHttpBinding_Service1" maxBufferSize="65536"&lt;br /&gt;
                    maxReceivedMessageSize="65536"&amp;gt;&lt;br /&gt;
                    &amp;lt;security mode="None" /&amp;gt;&lt;br /&gt;
                &amp;lt;/binding&amp;gt;&lt;br /&gt;
            &amp;lt;/basicHttpBinding&amp;gt;&lt;br /&gt;
        &amp;lt;/bindings&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;&lt;br /&gt;
            &amp;lt;endpoint address="&lt;a href="http://localhost:1205/Service1.svc&amp;quot;"&gt;http://localhost:1205/Service1.svc"&lt;/a&gt; binding="basicHttpBinding"&lt;br /&gt;
                bindingConfiguration="BasicHttpBinding_Service1" contract="ServiceReference1.Service1"&lt;br /&gt;
                name="BasicHttpBinding_Service1" /&amp;gt;&lt;br /&gt;
        &amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
In the endpoint address change the contract to include the project name.
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;
        &amp;lt;bindings&amp;gt;&lt;br /&gt;
            &amp;lt;basicHttpBinding&amp;gt;&lt;br /&gt;
                &amp;lt;binding name="BasicHttpBinding_Service1" maxBufferSize="65536"&lt;br /&gt;
                    maxReceivedMessageSize="65536"&amp;gt;&lt;br /&gt;
                    &amp;lt;security mode="None" /&amp;gt;&lt;br /&gt;
                &amp;lt;/binding&amp;gt;&lt;br /&gt;
            &amp;lt;/basicHttpBinding&amp;gt;&lt;br /&gt;
        &amp;lt;/bindings&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;&lt;br /&gt;
            &amp;lt;endpoint address="&lt;a href="http://localhost:1205/Service1.svc&amp;quot;"&gt;http://localhost:1205/Service1.svc"&lt;/a&gt; binding="basicHttpBinding"&lt;br /&gt;
                bindingConfiguration="BasicHttpBinding_Service1" contract="SilverlightApplication2.ServiceReference1.Service1"&lt;br /&gt;
                name="BasicHttpBinding_Service1" /&amp;gt;&lt;br /&gt;
        &amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Now lets add some code to call the service. Page.Xaml.VB
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Partial Public Class Page&lt;br /&gt;
    Inherits UserControl&lt;br /&gt;
    Dim current As String  
&lt;/p&gt;
&lt;p&gt;
    Public Sub New()&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
    End Sub  
&lt;/p&gt;
&lt;p&gt;
    Private Sub Page_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded&lt;br /&gt;
        Dim ws As New ServiceReference1.Service1Client&lt;br /&gt;
        AddHandler ws.SayHelloCompleted, AddressOf HelloComplete&lt;br /&gt;
        ws.SayHelloAsync()&lt;br /&gt;
    End Sub  
&lt;/p&gt;
&lt;p&gt;
    Private Sub HelloComplete(ByVal sender As Object, ByVal e As ServiceReference1.SayHelloCompletedEventArgs)&lt;br /&gt;
        txt.Text = e.Result&lt;br /&gt;
    End Sub  
&lt;/p&gt;
&lt;p&gt;
End Class  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Now if we run the app you should see Hello World but when published you will only see loading.   So lets change how we create the service so that this will work once deployed.  Basically we tell the service to use the current web address.
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Private Sub Page_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded&lt;br /&gt;
    Dim address = New Uri(Application.Current.Host.Source, "../Service1.svc")  
&lt;/p&gt;
&lt;p&gt;
    Dim ws As New ServiceReference1.Service1Client("BasicHttpBinding_Service1", address.AbsoluteUri)&lt;br /&gt;
    AddHandler ws.SayHelloCompleted, AddressOf HelloComplete&lt;br /&gt;
    ws.SayHelloAsync()&lt;br /&gt;
End Sub  
&lt;/p&gt;
&lt;p&gt;
  
&lt;/p&gt;
&lt;p&gt;
Hope this helps  
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/20.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2009/02/15/publishing-a-vb-silverlight-2-beta-2-app-which-uses.aspx</guid>
            <pubDate>Sun, 15 Feb 2009 10:09:36 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/20.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2009/02/15/publishing-a-vb-silverlight-2-beta-2-app-which-uses.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/20.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Snippet Editor</title>
            <link>http://blog.onteorasoftware.net/archive/2009/01/25/snippet-editor.aspx</link>
            <description>&lt;p&gt;
Bill McCarthy has moved the Snippet Editor project to Code Plex and added some nice new features
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
Features include:
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Complete snippet file management &lt;/li&gt;
	&lt;li&gt;basic syntax coloring &lt;/li&gt;
	&lt;li&gt;replacement highlighting &lt;/li&gt;
	&lt;li&gt;drag and drop file organisation &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;br /&gt;
The Snippet Editor is a stand-alone exe suitable for all versions&lt;br /&gt;
of Visual Studio 2005 and 2008 including the Express editions:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SnippetEditor&amp;amp;DownloadId=53283" alt="snippet_editor.png" width="580" height="583" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The left hand pane provides for snippet collection management. &lt;br /&gt;
You can select which of your product collection to edit, filter the &lt;br /&gt;
collection based on a search phrase, add and remove snippets, &lt;br /&gt;
add existing folders, remove folders from the collection and &lt;br /&gt;
move snippets around by simple drag and drop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SnippetEditor&amp;amp;DownloadId=53284" alt="snippet_navigation.png" width="373" height="435" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code editor provide basic syntax highlighting, and snippet &lt;br /&gt;
replacement highlighting, navigation, editing, adding and deleting.&lt;br /&gt;
Resize the code editor pane, collapse or expand the Properties, &lt;br /&gt;
Imports or References panes, and your layout is remembered for&lt;br /&gt;
next time you use the editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SnippetEditor&amp;amp;DownloadId=53280" alt="snippet_code.png" width="643" height="511" /&gt;
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Download a copy today
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/SnippetEditor"&gt;http://www.codeplex.com/SnippetEditor&lt;/a&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.onteorasoftware.net%2fpost%2fSnippet-Editor.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.onteorasoftware.net%2fpost%2fSnippet-Editor.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/10.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2009/01/25/snippet-editor.aspx</guid>
            <pubDate>Sun, 25 Jan 2009 12:51:51 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/10.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2009/01/25/snippet-editor.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/10.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Space Coast .Net Winter 09 Tiki Hut Tour</title>
            <link>http://blog.onteorasoftware.net/archive/2009/01/25/space-coast-.net-winter-09-tiki-hut-tour.aspx</link>
            <description>&lt;p&gt;
&lt;span&gt;&lt;span style="font-size: large; font-weight: bold; color: #ff0000"&gt;MSDN Tiki Hut Roadshow&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span class="timezone"&gt;Wednesday, February 18, 2009 6:30 PM - Wednesday, February 18, 2009 9:30 PM Eastern Time (US &amp;amp; Canada)&lt;/span&gt;
&lt;span class="timezone"&gt;
&lt;br /&gt;
Welcome Time: 6:00 PM&lt;/span&gt;
&lt;!-- start of Event address --&gt;
&lt;br /&gt;
&lt;span&gt;Space Coast Credit Union Corporate Headquarters&lt;/span&gt;
&lt;br /&gt;
&lt;span /&gt;
&lt;/p&gt;
&lt;div id="panLocationAddress"&gt;
&lt;span&gt;8045 N. Wickham Road&lt;br /&gt;
&lt;/span&gt;
&lt;span&gt;Melbourne&lt;/span&gt;
&lt;span&gt;Florida&lt;/span&gt;
&lt;span&gt;32940&lt;br /&gt;
&lt;/span&gt;
&lt;span&gt;United States&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;strong&gt;Session 1 – jQuery with ASP.NET&lt;/strong&gt;
- JQuery is an open source JavaScript library that has a passionate
following among Ajax developers. Microsoft is integrating the open
source JQuery library into both the ASP.NET Web Forms and ASP.NET MVC
frameworks and providing full product support. Learn how you can take
advantage of JQuery to build richly interactive client-side Ajax
applications when developing either ASP.NET Web Forms or ASP.NET MVC
applications. Also see how JQuery works in combination with ASP.NET
AJAX to provide the best framework for building Ajax applications.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Session 2 – Data Services&lt;/strong&gt; - OnPremise and Off -
In the near future, applications will be developed using a combination
of custom application code and online building block services,
including data-centric services. In this session we discuss
advancements in the Microsoft development platform and online service
interfaces to enable seamless interaction with data services both
on-premises (e.g., ADO.NET Data Services Framework over on-premises SQL
Server) and in the cloud (e.g., SQL Server Data Services). Learn how
you can leverage existing know-how related to LINQ (Language Integrated
Query), data access APIs, data-binding, and more when building
applications using online data.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Session 3 – Architecting for the Cloud using Windows Azure&lt;/strong&gt;
- This session provides a tour of the Windows Azure cloud computing
platform, an overview of its various components, and explains how these
fit together to provide best-of-cloud experiences. We will explore the
architecture that links many of the Microsoft .NET services and lets
ISVs and businesses deliver compelling solutions. Learn how to compose
these services with SQL Data Services to create applications in the
cloud and connect them with on-premise systems. We will also examine
the next generation of messaging, data, access control, and directory
services, and how they fit together to provide a seamless integration
into the cloud.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Speaker’s Bios:&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Joe Healy &lt;/strong&gt;( &lt;a href="http://www.devfish.net/"&gt;http://www.devfish.net&lt;/a&gt;
) is the Developer Evangelist for Microsoft Gulf States Accounts, based
out of Tampa Florida. Joe’s geographical responsibility is to provide
‘developer care’ for the state of Florida. Joe serves a multitude of
clients, from corporate accounts to broad reach events and User Groups.
He lectures on various development and architectural topics focused
around the .Net Frameworks, Visual Studio.NET, and associated servers.
Joe has also served time with eAngler.com, Arthur Andersen, Cap Gemini,
EDS, and IBM in various capacities.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Jeff Barnes&lt;/strong&gt; (Architecture: The Harmony of Mathematical Precision; 
&lt;a href="http://blogs.msdn.com/jbarnes"&gt;http://blogs.msdn.com/jbarnes&lt;/a&gt;
) is the Microsoft Architect Evangelist for the Gulf States District
where he engages with the local Architect community to help solve tough
business problems with leading-edge technology. Jeff has been with
Microsoft for over 10 years and has spent over 7 of those years as an
architect in the Microsoft Consulting Services organization working
with large enterprise customers throughout North America. He especially
enjoys the freedom and flexibility that .NET brings to the table in
order solve the next generation of tough technical challenges.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Register if you plan to attend this event
&lt;/p&gt;
&lt;p&gt;
&lt;a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032400629&amp;amp;culture=en-US"&gt; https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032400629&amp;amp;culture=en-US&lt;/a&gt;
&lt;/p&gt;
&lt;span /&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/7.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2009/01/25/space-coast-.net-winter-09-tiki-hut-tour.aspx</guid>
            <pubDate>Sun, 25 Jan 2009 12:47:20 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/7.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2009/01/25/space-coast-.net-winter-09-tiki-hut-tour.aspx#feedback</comments>
            <slash:comments>42</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/7.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Validating Data entered in a DataRepeater control</title>
            <link>http://blog.onteorasoftware.net/archive/2008/05/07/validating-data-entered-in-a-datarepeater-control.aspx</link>
            <description>&lt;p&gt;In this example I will show how to validate the data entered into a datarepeater control. For this example I am added the northwind SQL compact edition database to the project and created a typed dataset for the products table.  So from the toolbox drop a datarepeater on the form.  Inside the datarepeater drag the ProductName, UnitPrice, and Units in stock fields. Your form should look something like&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.onteorasoftware.net/image.axd?picture=WindowsLiveWriter/ValidatingDataenteredinaDataRepeatercont_5EAF/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="198" alt="image" src="http://www.onteorasoftware.net/image.axd?picture=WindowsLiveWriter/ValidatingDataenteredinaDataRepeatercont_5EAF/image_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Now in the drawitem event for the datarepeater we can add a handler to validating event.&lt;/p&gt; &lt;p&gt;Private Sub DataRepeater1_DrawItem(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.PowerPacks.DataRepeaterItemEventArgs) Handles DataRepeater1.DrawItem&lt;br /&gt;    Dim currItem As DataRowView = DirectCast(ProductsBindingSource.Item(e.DataRepeaterItem.ItemIndex), DataRowView)&lt;br /&gt;    Dim txt As TextBox = DirectCast(e.DataRepeaterItem.Controls("Unit_PriceTextBox"), TextBox)&lt;br /&gt;    AddHandler txt.Validating, AddressOf TextBox_Validating&lt;br /&gt;End Sub  &lt;/p&gt;&lt;p&gt;Private Sub TextBox_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)&lt;br /&gt;    Dim dec As Decimal&lt;br /&gt;    If Not Decimal.TryParse(DirectCast(sender, TextBox).Text, dec) Then&lt;br /&gt;        MessageBox.Show("Please enter a valid number")&lt;br /&gt;        e.Cancel = True&lt;br /&gt;    End If&lt;br /&gt;End Sub  &lt;/p&gt;&lt;p&gt; &lt;/p&gt; &lt;p&gt;The complete code&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Public Class Form1  &lt;/p&gt;&lt;p&gt;    Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductsBindingNavigatorSaveItem.Click&lt;br /&gt;        Me.Validate()&lt;br /&gt;        Me.ProductsBindingSource.EndEdit()&lt;br /&gt;        Me.TableAdapterManager.UpdateAll(Me.NorthwindDataSet)  &lt;/p&gt;&lt;p&gt;    End Sub  &lt;/p&gt;&lt;p&gt;    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;        'TODO: This line of code loads data into the 'NorthwindDataSet.Products' table. You can move, or remove it, as needed.&lt;br /&gt;        Me.ProductsTableAdapter.Fill(Me.NorthwindDataSet.Products)  &lt;/p&gt;&lt;p&gt;    End Sub  &lt;/p&gt;&lt;p&gt;    Private Sub DataRepeater1_DrawItem(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.PowerPacks.DataRepeaterItemEventArgs) Handles DataRepeater1.DrawItem&lt;br /&gt;        Dim currItem As DataRowView = DirectCast(ProductsBindingSource.Item(e.DataRepeaterItem.ItemIndex), DataRowView)&lt;br /&gt;        Dim txt As TextBox = DirectCast(e.DataRepeaterItem.Controls("Unit_PriceTextBox"), TextBox)&lt;br /&gt;        AddHandler txt.Validating, AddressOf TextBox_Validating&lt;br /&gt;    End Sub  &lt;/p&gt;&lt;p&gt;    Private Sub TextBox_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)&lt;br /&gt;        Dim dec As Decimal&lt;br /&gt;        If Not Decimal.TryParse(DirectCast(sender, TextBox).Text, dec) Then&lt;br /&gt;            MessageBox.Show("Please enter a valid number")&lt;br /&gt;            e.Cancel = True&lt;br /&gt;        End If&lt;br /&gt;    End Sub&lt;br /&gt;End Class&lt;/p&gt;&lt;img src="http://blog.onteorasoftware.net/aggbug/24.aspx" width="1" height="1" /&gt;</description>
            <guid>http://blog.onteorasoftware.net/archive/2008/05/07/validating-data-entered-in-a-datarepeater-control.aspx</guid>
            <pubDate>Wed, 07 May 2008 04:47:40 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/24.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2008/05/07/validating-data-entered-in-a-datarepeater-control.aspx#feedback</comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/24.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Regular Expression Help</title>
            <link>http://blog.onteorasoftware.net/archive/2008/04/28/regular-expression-help.aspx</link>
            <description>&lt;p&gt;
I got an regualr expression question today from one of my friends.  Basically she was using a regular expression &lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif'"&gt; to validate a number was 4 or 6 digits long but the expression she was using &lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif'"&gt;^\d{4,6}$ would validate numbers 5 digits long.  Lets look at this regular expression ^ means starts with. The \d means number and the {4,6} means 4 to 6 digits long.  The $ means ends with. The answer is to use a regular express with an or (the | means or)&lt;/span&gt;&lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif'"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif'" /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif'"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif'"&gt;&lt;font size="2" /&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; regNum &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;New&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Regex(&lt;/font&gt;&lt;font size="2" color="#a31515"&gt;&lt;font size="2" color="#a31515"&gt;"^\d{4}$|^\d{6}$"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;
Debug.Print(regNum.IsMatch(&lt;font size="2" color="#a31515"&gt;&lt;font size="2" color="#a31515"&gt;"1234"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).ToString)&lt;/font&gt; 
&lt;/p&gt;
&lt;font size="2"&gt;Debug.Print(regNum.IsMatch(&lt;/font&gt; &lt;/font&gt;&lt;font size="2" color="#a31515"&gt;&lt;font size="2" color="#a31515"&gt;"12345"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).ToString)&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;
Debug.Print(regNum.IsMatch(&lt;font size="2" color="#a31515"&gt;&lt;font size="2" color="#a31515"&gt;"123456"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).ToString)&lt;/font&gt; 
&lt;/p&gt;
&lt;/font&gt;
&lt;p&gt;
&lt;font size="2" /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Output&lt;/font&gt; 
&lt;/p&gt;
&lt;font size="2"&gt;&lt;font size="1"&gt;
&lt;p&gt;
True 
&lt;/p&gt;
&lt;p&gt;
False 
&lt;/p&gt;
&lt;p&gt;
True 
&lt;/p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/27.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2008/04/28/regular-expression-help.aspx</guid>
            <pubDate>Mon, 28 Apr 2008 18:31:07 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/27.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2008/04/28/regular-expression-help.aspx#feedback</comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/27.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Print to PDF</title>
            <link>http://blog.onteorasoftware.net/archive/2008/04/06/print-to-pdf.aspx</link>
            <description>&lt;p&gt;
The .Net framework provides a print document class for printing.  There are times that it would be nice to redirect what you are printing to a pdf.   In this example we are going to use the Sharp Pdf lib version 1.3.1 to print to a pdf.  
&lt;/p&gt;
&lt;p&gt;
The sharp pdf lib allows you to add an image to a page in a pdf.  To make it possible to print to a pdf we are going to create a new print controller class which creates a bitmap and has the print document draw the page on the bitmap.  Then it adds the bitmap as a pdf page.  Once the document is done printing it saves the pdf to disk.  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sharppdf.sourceforge.net/"&gt;http://sharppdf.sourceforge.net/&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Update this Project is now available on CodePlex
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Print2Pdf"&gt;http://www.codeplex.com/Print2Pdf&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Imports sharpPDF 
&lt;/p&gt;
&lt;p&gt;
Public Class PdfPrintController&lt;br /&gt;
    Inherits Printing.PrintController&lt;br /&gt;
    Dim pdf As pdfDocument&lt;br /&gt;
    Dim bm As Image 
&lt;/p&gt;
&lt;p&gt;
    Private _Author As String = "Unknown" 
&lt;/p&gt;
&lt;p&gt;
    Public Property Author() As String&lt;br /&gt;
        Get&lt;br /&gt;
            Return _Author&lt;br /&gt;
        End Get&lt;br /&gt;
        Set(ByVal value As String)&lt;br /&gt;
            _Author = value&lt;br /&gt;
        End Set&lt;br /&gt;
    End Property 
&lt;/p&gt;
&lt;p&gt;
    Private _FileName As String = "Printed.pdf"&lt;br /&gt;
    Public Property FileName() As String&lt;br /&gt;
        Get&lt;br /&gt;
            Return _FileName&lt;br /&gt;
        End Get&lt;br /&gt;
        Set(ByVal value As String)&lt;br /&gt;
            _FileName = value&lt;br /&gt;
        End Set&lt;br /&gt;
    End Property 
&lt;/p&gt;
&lt;p&gt;
    Private _Title As String = "Unknown"&lt;br /&gt;
    Public Property Title() As String&lt;br /&gt;
        Get&lt;br /&gt;
            Return _Title&lt;br /&gt;
        End Get&lt;br /&gt;
        Set(ByVal value As String)&lt;br /&gt;
            _Title = value&lt;br /&gt;
        End Set&lt;br /&gt;
    End Property 
&lt;/p&gt;
&lt;p&gt;
    Public Overrides ReadOnly Property IsPreview() As Boolean&lt;br /&gt;
        Get&lt;br /&gt;
            Return True&lt;br /&gt;
        End Get&lt;br /&gt;
    End Property 
&lt;/p&gt;
&lt;p&gt;
    Public Overrides Function OnStartPage(ByVal document As System.Drawing.Printing.PrintDocument, ByVal e As System.Drawing.Printing.PrintPageEventArgs) As System.Drawing.Graphics&lt;br /&gt;
        bm = New Bitmap(e.PageBounds.Width, e.PageBounds.Height)&lt;br /&gt;
        Dim g As Graphics = Graphics.FromImage(bm)&lt;br /&gt;
        g.Clear(Color.White)&lt;br /&gt;
        Return g&lt;br /&gt;
    End Function 
&lt;/p&gt;
&lt;p&gt;
    Public Overrides Sub OnStartPrint(ByVal document As System.Drawing.Printing.PrintDocument, ByVal e As System.Drawing.Printing.PrintEventArgs)&lt;br /&gt;
        pdf = New pdfDocument(Title, Author)&lt;br /&gt;
        MyBase.OnStartPrint(document, e)&lt;br /&gt;
    End Sub 
&lt;/p&gt;
&lt;p&gt;
    Public Overrides Sub OnEndPage(ByVal document As System.Drawing.Printing.PrintDocument, ByVal e As System.Drawing.Printing.PrintPageEventArgs)&lt;br /&gt;
        Dim p As pdfPage = pdf.addPage(e.PageBounds.Height, e.PageBounds.Width)&lt;br /&gt;
        p.addImage(bm, 0, 0)&lt;br /&gt;
        MyBase.OnEndPage(document, e)&lt;br /&gt;
    End Sub 
&lt;/p&gt;
&lt;p&gt;
    Public Overrides Sub OnEndPrint(ByVal document As System.Drawing.Printing.PrintDocument, ByVal e As System.Drawing.Printing.PrintEventArgs)&lt;br /&gt;
        pdf.createPDF(FileName)&lt;br /&gt;
        MyBase.OnEndPrint(document, e)&lt;br /&gt;
    End Sub 
&lt;/p&gt;
&lt;p&gt;
End Class 
&lt;/p&gt;
&lt;p&gt;
Here is a sample which creates a pdf of the Northwind product list. 
&lt;/p&gt;
&lt;p&gt;
Imports System.Data.SqlClient 
&lt;/p&gt;
&lt;p&gt;
Public Class Form1&lt;br /&gt;
    Public WithEvents p As New Printing.PrintDocument&lt;br /&gt;
    Dim iRecord As Integer = 0&lt;br /&gt;
    Dim fntPrice As New Font("Arial", 12)&lt;br /&gt;
    Dim ds As New DataSet 
&lt;/p&gt;
&lt;p&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim strConn As String&lt;br /&gt;
        Dim conn As SqlConnection&lt;br /&gt;
        Dim da As SqlDataAdapter 
&lt;/p&gt;
&lt;p&gt;
        strConn = "Server = .\SQLEXPRESS;"&lt;br /&gt;
        strConn &amp;amp;= "Database = Northwind; Integrated Security = SSPI;"&lt;br /&gt;
        conn = New SqlConnection(strConn)&lt;br /&gt;
        da = New SqlDataAdapter("Select ProductName, UnitPrice From Products", conn)&lt;br /&gt;
        da.Fill(ds, "Products") 
&lt;/p&gt;
&lt;p&gt;
        DataGridView1.DataSource = ds.Tables("Products")&lt;br /&gt;
    End Sub 
&lt;/p&gt;
&lt;p&gt;
    Private Sub p_BeginPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles p.BeginPrint&lt;br /&gt;
        iRecord = 0&lt;br /&gt;
    End Sub 
&lt;/p&gt;
&lt;p&gt;
    Private Sub p_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles p.PrintPage&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim iPageHeight As Integer = e.PageBounds.Height&lt;br /&gt;
        Dim iPageWidth As Integer = e.PageBounds.Width&lt;br /&gt;
        Dim iFntHeight As Integer = CInt(g.MeasureString("Test", fntPrice).Height)&lt;br /&gt;
        Dim iLinesPerPage As Integer = iPageHeight \ iFntHeight - 15&lt;br /&gt;
        Dim yPos As Integer = 0&lt;br /&gt;
        Dim iTop As Integer&lt;br /&gt;
        Dim iMax As Integer = ds.Tables("Products").Rows.Count&lt;br /&gt;
        Dim strDescription As String&lt;br /&gt;
        Dim x As Integer&lt;br /&gt;
        Dim xPos As Integer&lt;br /&gt;
        Dim strPrice As String&lt;br /&gt;
        Dim fntTitle As Font = New Font("Microsoft Sans Serf", 14)&lt;br /&gt;
        Dim iCount As Integer = ds.Tables("Products").Rows.Count&lt;br /&gt;
        Dim strDate As String = Trim(Now.ToLongDateString)&lt;br /&gt;
        Dim sf As New StringFormat&lt;br /&gt;
        sf.Alignment = StringAlignment.Far 
&lt;/p&gt;
&lt;p&gt;
        xPos = CInt(iPageWidth - g.MeasureString("Price List", fntTitle).Width) \ 2&lt;br /&gt;
        g.DrawString("Price List", fntTitle, Brushes.Black, xPos, 10)&lt;br /&gt;
        yPos = 10 + CInt(g.MeasureString("Price List", fntTitle).Height) 
&lt;/p&gt;
&lt;p&gt;
        xPos = CInt(iPageWidth - g.MeasureString(strDate, fntPrice).Width) \ 2&lt;br /&gt;
        g.DrawString(strDate, fntPrice, Brushes.Black, xPos, yPos)&lt;br /&gt;
        yPos += 2 * iFntHeight&lt;br /&gt;
        g.DrawString("Product", fntPrice, Brushes.Black, 50, yPos) 
&lt;/p&gt;
&lt;p&gt;
        g.DrawString("Price", fntPrice, Brushes.Black, _&lt;br /&gt;
                New Rectangle(430, yPos, 100, 2 * iFntHeight), sf) 
&lt;/p&gt;
&lt;p&gt;
        yPos += iFntHeight&lt;br /&gt;
        g.DrawLine(Pens.Black, 0, yPos, iPageWidth, yPos) 
&lt;/p&gt;
&lt;p&gt;
        e.HasMorePages = True&lt;br /&gt;
        iTop = yPos 
&lt;/p&gt;
&lt;p&gt;
        For x = 0 To iLinesPerPage&lt;br /&gt;
            If iRecord &amp;lt; imax Then&lt;br /&gt;
                With ds.Tables("Products").Rows(iRecord)&lt;br /&gt;
                    strDescription = .Item("ProductName").ToString&lt;br /&gt;
                    strPrice = Convert.ToDecimal(.Item("UnitPrice")).ToString("c")&lt;br /&gt;
                End With&lt;br /&gt;
                Dim rName As New Rectangle(5, yPos, 400, iFntHeight)&lt;br /&gt;
                Dim rPrice As New Rectangle(430, yPos, 100, iFntHeight) 
&lt;/p&gt;
&lt;p&gt;
                g.DrawString(strDescription, fntPrice, Brushes.Black, rName)&lt;br /&gt;
                g.DrawString(strPrice, fntPrice, Brushes.Black, rPrice, sf)&lt;br /&gt;
            Else&lt;br /&gt;
                e.HasMorePages = False&lt;br /&gt;
            End If&lt;br /&gt;
            yPos += iFntHeight&lt;br /&gt;
            iRecord += 1&lt;br /&gt;
        Next&lt;br /&gt;
        fntTitle.Dispose()&lt;br /&gt;
        If e.HasMorePages = False Then iRecord = 0&lt;br /&gt;
    End Sub 
&lt;/p&gt;
&lt;p&gt;
    Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click&lt;br /&gt;
        Dim pc As New PdfPrintController&lt;br /&gt;
        pc.Title = "Test Pdf"&lt;br /&gt;
        pc.Author = "Ken Tucker"&lt;br /&gt;
        pc.FileName = "Test.pdf"&lt;br /&gt;
        p.PrintController = pc&lt;br /&gt;
        p.Print()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class 
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.onteorasoftware.net%2fpost%2fPrint-to-PDF.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.onteorasoftware.net%2fpost%2fPrint-to-PDF.aspx" border="0" alt="kick it on DotNetKicks.com" width="82" height="18" /&gt;&lt;/a&gt; 
&lt;img src="http://blog.onteorasoftware.net/aggbug/28.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2008/04/06/print-to-pdf.aspx</guid>
            <pubDate>Sun, 06 Apr 2008 17:30:12 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/28.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2008/04/06/print-to-pdf.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/28.aspx</wfw:commentRss>
        </item>
        <item>
            <title>VB Cascading Drop Down Example</title>
            <link>http://blog.onteorasoftware.net/archive/2008/04/01/vb-cascading-drop-down-example.aspx</link>
            <description>&lt;p&gt;
Here is simple VB example of the AjaxToolkit's CascadingDropDown extender.  For this example I use the CarsService.Xml found in the AjaxToolkits sample site.  The xml file needs to be placed in the App_data directory
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Here is the Pages Html
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;font size="2"&gt;
&lt;p&gt;
&amp;lt;%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&amp;lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "&lt;a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&lt;/a&gt;"&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns="&lt;a href="http://www.w3.org/1999/xhtml"&gt;http://www.w3.org/1999/xhtml&lt;/a&gt;"&amp;gt;&lt;br /&gt;
&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;asp:ScriptManager ID="sm1" EnablePageMethods="true" runat="server"&amp;gt;&lt;br /&gt;
        &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;
        &amp;lt;table&amp;gt;&lt;br /&gt;
            &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&lt;br /&gt;
                    Make&lt;br /&gt;
                &amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&lt;br /&gt;
                    &amp;lt;asp:DropDownList ID="DropDownList1" runat="server" Width="341px"&amp;gt;&lt;br /&gt;
                    &amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;
                &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;/tr&amp;gt;&lt;br /&gt;
            &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&lt;br /&gt;
                    Model&lt;br /&gt;
                &amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&lt;br /&gt;
                    &amp;lt;asp:DropDownList ID="DropDownList2" runat="server" Width="341px"&amp;gt;&lt;br /&gt;
                    &amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;
                &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;/tr&amp;gt;&lt;br /&gt;
            &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&lt;br /&gt;
                    Color&lt;br /&gt;
                &amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&lt;br /&gt;
                    &amp;lt;asp:DropDownList ID="DropDownList3" runat="server"  Width="341px"&amp;gt;&lt;br /&gt;
                    &amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;
                &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="DropDownList1"&lt;br /&gt;
            Category="Make"  PromptText="Please select a make"  LoadingText="[Loading makes...]" ServiceMethod="GetDropDownContents"&amp;gt;&lt;br /&gt;
    &amp;lt;/cc1:CascadingDropDown&amp;gt;&lt;br /&gt;
    &amp;lt;cc1:CascadingDropDown ID="CascadingDropDown2" runat="server" TargetControlID="DropDownList2"&lt;br /&gt;
            Category="Model" PromptText="Please select a model" LoadingText="[Loading models...]"&lt;br /&gt;
            ServiceMethod="GetDropDownContents" ParentControlID="DropDownList1"&amp;gt;&lt;br /&gt;
    &amp;lt;/cc1:CascadingDropDown&amp;gt;&lt;br /&gt;
    &amp;lt;cc1:CascadingDropDown ID="CascadingDropDown3" runat="server" TargetControlID="DropDownList3"&lt;br /&gt;
            Category="Color" PromptText="Please select a color" LoadingText="[Loading colors...]"&lt;br /&gt;
            ServiceMethod="GetDropDownContents"&lt;br /&gt;
            ParentControlID="DropDownList2"&amp;gt;&lt;br /&gt;
    &amp;lt;/cc1:CascadingDropDown&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
In the code behind I am using a shared class so I only have to load the xml document once.
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Imports System.Xml
&lt;/p&gt;
&lt;p&gt;
Partial Class _Default&lt;br /&gt;
    Inherits System.Web.UI.Page
&lt;/p&gt;
&lt;p&gt;
    &amp;lt;System.Web.Services.WebMethod()&amp;gt; _&lt;br /&gt;
&amp;lt;System.Web.Script.Services.ScriptMethod()&amp;gt; _&lt;br /&gt;
 Public Shared Function GetDropDownContents(ByVal knownCategoryValues As String, ByVal category As String) As AjaxControlToolkit.CascadingDropDownNameValue()&lt;br /&gt;
        Dim knownCategoryValuesDictionary As StringDictionary = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
&lt;/p&gt;
&lt;p&gt;
        Return AjaxControlToolkit.CascadingDropDown.QuerySimpleCascadingDropDownDocument(CarsInfo.Document, CarsInfo.Hierarchy, knownCategoryValuesDictionary, category)&lt;br /&gt;
    End Function&lt;br /&gt;
End Class
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
Public Class CarsInfo&lt;br /&gt;
    Private Shared _Doc As XmlDocument&lt;br /&gt;
    Private Shared _load As Boolean = True
&lt;/p&gt;
&lt;p&gt;
    Public Shared ReadOnly Property Document() As XmlDocument&lt;br /&gt;
        Get&lt;br /&gt;
            If _load Then&lt;br /&gt;
                _Doc = New XmlDocument&lt;br /&gt;
                _Doc.Load(HttpContext.Current.Server.MapPath("~/App_Data/CarsService.xml"))&lt;br /&gt;
                _load = False&lt;br /&gt;
            End If&lt;br /&gt;
            Return _Doc&lt;br /&gt;
        End Get&lt;br /&gt;
    End Property
&lt;/p&gt;
&lt;p&gt;
    Public Shared ReadOnly Property Hierarchy() As String()&lt;br /&gt;
        Get&lt;br /&gt;
            Return New String() {"make", "model"}&lt;br /&gt;
        End Get&lt;br /&gt;
    End Property&lt;br /&gt;
End Class
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;/font&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/29.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2008/04/01/vb-cascading-drop-down-example.aspx</guid>
            <pubDate>Tue, 01 Apr 2008 15:03:31 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/29.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2008/04/01/vb-cascading-drop-down-example.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/29.aspx</wfw:commentRss>
        </item>
        <item>
            <title>DataGridViewCombobox AutoComplete</title>
            <link>http://blog.onteorasoftware.net/archive/2008/03/26/datagridviewcombobox-autocomplete.aspx</link>
            <description>&lt;p&gt;
&lt;span&gt;
&lt;p align="left"&gt;
&lt;font face="Arial" size="2"&gt;Here is a quick example on using an autocomplete combobox in the DataGridView.  In this example I load all the possible values for the combobox into a AutoCompleteStringCollection and make that the DataGridViewComboBox's datasource.  In the editingControl showing event you need to set the ComboBox's DropDownStyle, and the auto complete settings.&lt;br /&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p align="left"&gt;
 
&lt;/p&gt;
&lt;p align="left"&gt;
Imports System.Data.SqlClient
&lt;/p&gt;
&lt;p align="left"&gt;
Public Class Form1&lt;br /&gt;
    Dim scAutoComplete As New AutoCompleteStringCollection
&lt;/p&gt;
&lt;p align="left"&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim strConn As String&lt;br /&gt;
        Dim da As SqlDataAdapter&lt;br /&gt;
        Dim conn As SqlConnection&lt;br /&gt;
        Dim ds As New DataSet&lt;br /&gt;
        strConn = "Server = .\SQLEXPRESS;Database = NorthWind; Integrated Security = SSPI;"&lt;br /&gt;
        conn = New SqlConnection(strConn)&lt;br /&gt;
        da = New SqlDataAdapter("Select * from [Orders]", conn)&lt;br /&gt;
        da.Fill(ds, "Orders")&lt;br /&gt;
        DataGridView1.DataSource = ds.Tables("Orders")
&lt;/p&gt;
&lt;p align="left"&gt;
        Dim cmd As New SqlCommand("Select CustomerID From customers", conn)&lt;br /&gt;
        Dim dr As SqlDataReader&lt;br /&gt;
        conn.Open()&lt;br /&gt;
        dr = cmd.ExecuteReader&lt;br /&gt;
        Do While dr.Read&lt;br /&gt;
            scAutoComplete.Add(dr.GetString(0))&lt;br /&gt;
        Loop&lt;br /&gt;
        conn.Close()
&lt;/p&gt;
&lt;p align="left"&gt;
        Dim dgvcbc As New DataGridViewComboBoxColumn&lt;br /&gt;
        With dgvcbc&lt;br /&gt;
            .DataPropertyName = "CustomerID"&lt;br /&gt;
            .DataSource = scAutoComplete&lt;br /&gt;
            .HeaderText = "Customer ID"&lt;br /&gt;
        End With&lt;br /&gt;
        DataGridView1.Columns.Remove("CustomerID")&lt;br /&gt;
        DataGridView1.Columns.Insert(1, dgvcbc)&lt;br /&gt;
    End Sub
&lt;/p&gt;
&lt;p align="left"&gt;
    Private Sub
DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewEditingControlShowingEventArgs)
Handles DataGridView1.EditingControlShowing&lt;br /&gt;
        If DataGridView1.CurrentCell.ColumnIndex = 1 AndAlso TypeOf e.Control Is ComboBox Then&lt;br /&gt;
            With DirectCast(e.Control, ComboBox)&lt;br /&gt;
                .DropDownStyle = ComboBoxStyle.DropDown&lt;br /&gt;
                .AutoCompleteMode = AutoCompleteMode.SuggestAppend&lt;br /&gt;
                .AutoCompleteSource = AutoCompleteSource.CustomSource&lt;br /&gt;
                .AutoCompleteCustomSource = scAutoComplete&lt;br /&gt;
            End With&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub
&lt;/p&gt;
&lt;p align="left"&gt;
End Class
&lt;/p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fonteorasoftware.net%2fpost%2fDataGridViewCombobox-AutoComplete.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fonteorasoftware.net%2fpost%2fDataGridViewCombobox-AutoComplete.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/30.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2008/03/26/datagridviewcombobox-autocomplete.aspx</guid>
            <pubDate>Wed, 26 Mar 2008 10:09:46 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/30.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2008/03/26/datagridviewcombobox-autocomplete.aspx#feedback</comments>
            <slash:comments>12</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/30.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>