<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>CodeKeep VB.NET Feed</title>
    <description>The latest and greatest VB.NET code snippets publicly available</description>
    <link>http://www.codekeep.net/feeds.aspx</link>
    <lastBuildDate>Mon, 13 May 2013 13:25:22 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CodeKeepVBNET" /><feedburner:info uri="codekeepvbnet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>compare objects properties</title>
      <description>Description: compare the values of properties of the two supplied objects&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/407e1d1b-f6f1-4146-aa04-a0c4e2ee8162.aspx'&gt;http://www.codekeep.net/snippets/407e1d1b-f6f1-4146-aa04-a0c4e2ee8162.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;  ''' &amp;lt;summary&amp;gt;
        ''' Compares the properties of two objects of the same type and returns if all properties are equal.
        ''' &amp;lt;/summary&amp;gt;
        ''' &amp;lt;param name=&amp;quot;objectA&amp;quot;&amp;gt;The first object to compare.&amp;lt;/param&amp;gt;
        ''' &amp;lt;param name=&amp;quot;objectB&amp;quot;&amp;gt;The second object to compre.&amp;lt;/param&amp;gt;
        ''' &amp;lt;param name=&amp;quot;ignoreList&amp;quot;&amp;gt;A list of property names to ignore from the comparison.&amp;lt;/param&amp;gt;
        ''' &amp;lt;returns&amp;gt;&amp;lt;c&amp;gt;true&amp;lt;/c&amp;gt; if all property values are equal, otherwise &amp;lt;c&amp;gt;false&amp;lt;/c&amp;gt;.&amp;lt;/returns&amp;gt;
        Public Shared Function AreObjectsEqual(ByVal objectA As Object, ByVal objectB As Object, ByVal ParamArray ignoreList As String()) As Boolean
            Dim result As Boolean
            If objectA IsNot Nothing AndAlso objectB IsNot Nothing Then
                Dim objectType As Type
                objectType = objectA.[GetType]()
                result = True
                ' assume by default they are equal
                For Each propertyInfo As PropertyInfo In objectType.GetProperties(BindingFlags.[Public] Or BindingFlags.Instance).Where(Function(p) p.CanRead AndAlso Not ignoreList.Contains(p.Name))
                    Dim valueA As Object
                    Dim valueB As Object

                    valueA = propertyInfo.GetValue(objectA, Nothing)
                    valueB = propertyInfo.GetValue(objectB, Nothing)

                    ' if it is a primative type, value type or implements IComparable, just directly try and compare the value
                    If CanDirectlyCompare(propertyInfo.PropertyType) Then
                        If Not AreValuesEqual(valueA, valueB) Then
                            result = False
                        End If
                        ' if it implements IEnumerable, then scan any items
                    ElseIf GetType(IEnumerable).IsAssignableFrom(propertyInfo.PropertyType) Then
                        Dim collectionItems1 As IEnumerable(Of Object)
                        Dim collectionItems2 As IEnumerable(Of Object)
                        Dim collectionItemsCount1 As Integer
                        Dim collectionItemsCount2 As Integer
                        ' null check
                        If valueA Is Nothing AndAlso valueB IsNot Nothing OrElse valueA IsNot Nothing AndAlso valueB Is Nothing Then
                            result = False
                        ElseIf valueA IsNot Nothing AndAlso valueB IsNot Nothing Then
                            collectionItems1 = DirectCast(valueA, IEnumerable).Cast(Of Object)()
                            collectionItems2 = DirectCast(valueB, IEnumerable).Cast(Of Object)()
                            collectionItemsCount1 = collectionItems1.Count()
                            collectionItemsCount2 = collectionItems2.Count()

                            ' check the counts to ensure they match
                            If collectionItemsCount1 &amp;lt;&amp;gt; collectionItemsCount2 Then
                                result = False
                            Else
                                ' and if they do, compare each item... this assumes both collections have the same order
                                For i As Integer = 0 To collectionItemsCount1 - 1
                                    Dim collectionItem1 As Object
                                    Dim collectionItem2 As Object
                                    Dim collectionItemType As Type

                                    collectionItem1 = collectionItems1.ElementAt(i)
                                    collectionItem2 = collectionItems2.ElementAt(i)
                                    collectionItemType = collectionItem1.[GetType]()

                                    If CanDirectlyCompare(collectionItemType) Then
                                        If Not AreValuesEqual(collectionItem1, collectionItem2) Then
                                            result = False
                                        End If
                                    ElseIf Not AreObjectsEqual(collectionItem1, collectionItem2, ignoreList) Then
                                        result = False
                                    End If
                                Next
                            End If
                        End If
                    ElseIf propertyInfo.PropertyType.IsClass Then
                        If Not AreObjectsEqual(propertyInfo.GetValue(objectA, Nothing), propertyInfo.GetValue(objectB, Nothing), ignoreList) Then
                            result = False
                        End If
                    Else
                        result = False
                    End If
                Next
            Else
                result = Object.Equals(objectA, objectB)
            End If
            Return result
        End Function

        ''' &amp;lt;summary&amp;gt;
        ''' Determines whether value instances of the specified type can be directly compared.
        ''' &amp;lt;/summary&amp;gt;
        ''' &amp;lt;param name=&amp;quot;type&amp;quot;&amp;gt;The type.&amp;lt;/param&amp;gt;
        ''' &amp;lt;returns&amp;gt;
        '''   &amp;lt;c&amp;gt;true&amp;lt;/c&amp;gt; if this value instances of the specified type can be directly compared; otherwise, &amp;lt;c&amp;gt;false&amp;lt;/c&amp;gt;.
        ''' &amp;lt;/returns&amp;gt;
        Private Shared Function CanDirectlyCompare(ByVal type As Type) As Boolean
            Return GetType(IComparable).IsAssignableFrom(type) OrElse type.IsPrimitive OrElse type.IsValueType
        End Function

        ''' &amp;lt;summary&amp;gt;
        ''' Compares two values and returns if they are the same.
        ''' &amp;lt;/summary&amp;gt;
        ''' &amp;lt;param name=&amp;quot;valueA&amp;quot;&amp;gt;The first value to compare.&amp;lt;/param&amp;gt;
        ''' &amp;lt;param name=&amp;quot;valueB&amp;quot;&amp;gt;The second value to compare.&amp;lt;/param&amp;gt;
        ''' &amp;lt;returns&amp;gt;&amp;lt;c&amp;gt;true&amp;lt;/c&amp;gt; if both values match, otherwise &amp;lt;c&amp;gt;false&amp;lt;/c&amp;gt;.&amp;lt;/returns&amp;gt;
        Private Shared Function AreValuesEqual(ByVal valueA As Object, ByVal valueB As Object) As Boolean
            Dim result As Boolean
            Dim selfValueComparer As IComparable

            selfValueComparer = TryCast(valueA, IComparable)
            If valueA Is Nothing AndAlso valueB IsNot Nothing OrElse valueA IsNot Nothing AndAlso valueB Is Nothing Then
                result = False
                ' one of the values is null
            ElseIf selfValueComparer IsNot Nothing AndAlso selfValueComparer.CompareTo(valueB) &amp;lt;&amp;gt; 0 Then
                result = False
                ' the comparison using IComparable failed
            ElseIf Not Object.Equals(valueA, valueB) Then
                result = False
            Else
                ' the comparison using Equals failed
                result = True
            End If
            ' match
            Return result
        End Function
		
		
		&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/lXzLVuitpjU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/lXzLVuitpjU/407e1d1b-f6f1-4146-aa04-a0c4e2ee8162.aspx</link>
      <pubDate>Mon, 13 May 2013 13:25:22 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/407e1d1b-f6f1-4146-aa04-a0c4e2ee8162.aspx</feedburner:origLink></item>
    <item>
      <title>LINQ - Datatables</title>
      <description>Description: Example of working with data-tables and linq&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/eda8ed76-5681-4360-a4c5-292127193809.aspx'&gt;http://www.codekeep.net/snippets/eda8ed76-5681-4360-a4c5-292127193809.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;           
Dim productPrices As IEnumerable(Of ProductCurrencyRate)

productPrices = From product In Me._listdata.Tables(&amp;quot;Product&amp;quot;).AsEnumerable

                Join prices In Me._listdata.Tables(&amp;quot;ProductPrices&amp;quot;).AsEnumerable
                    On prices.Field(Of Integer)(&amp;quot;Product_ID&amp;quot;) Equals product.Field(Of Integer)(&amp;quot;Product_ID&amp;quot;)

                Join collection In Me._listdata.Tables(&amp;quot;ProductPriceCollection&amp;quot;).AsEnumerable
                    On collection.Field(Of Integer)(&amp;quot;ProductPrices_ID&amp;quot;) Equals prices.Field(Of Integer)(&amp;quot;ProductPrices_ID&amp;quot;)

                Join currency In Me._listdata.Tables(&amp;quot;ProductPriceByCurrency&amp;quot;).AsEnumerable
                    On currency.Field(Of Integer)(&amp;quot;ProductPriceCollection_ID&amp;quot;) Equals collection.Field(Of Integer)(&amp;quot;ProductPriceCollection_ID&amp;quot;)

                Select New ProductCurrencyRate With {.Quickref = product.Field(Of String)(&amp;quot;PID&amp;quot;),
                                                     .Code = currency.Field(Of String)(&amp;quot;Code&amp;quot;),
                                                     .UnitPrice = currency.Field(Of String)(&amp;quot;UnitPrice&amp;quot;),
                                                     .PreviousPrice = currency.Field(Of String)(&amp;quot;PreviousUnitPrice&amp;quot;),
                                                     .Tax = currency.Field(Of String)(&amp;quot;Tax&amp;quot;)}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/okB7N0UttFU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/okB7N0UttFU/eda8ed76-5681-4360-a4c5-292127193809.aspx</link>
      <pubDate>Wed, 30 Jan 2013 06:00:00 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/eda8ed76-5681-4360-a4c5-292127193809.aspx</feedburner:origLink></item>
    <item>
      <title>dbcolumn</title>
      <description>Description: need to lookinto&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/979c27dd-6a66-4b5d-b602-b5510b785405.aspx'&gt;http://www.codekeep.net/snippets/979c27dd-6a66-4b5d-b602-b5510b785405.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Imports System
Imports System.Data
Imports System.Data.Common
Imports System.Data.OleDb

Namespace DataAccess

    Namespace MSAccess

        ''' &amp;lt;summary&amp;gt;
        ''' Holds the values of a OleDb database column
        ''' &amp;lt;/summary&amp;gt;
        ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
        Public Class DbColumn

#Region &amp;quot;Enumerations&amp;quot;

            ''' &amp;lt;summary&amp;gt;
            ''' Contains a list of operators that can be used in queries
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;remarks&amp;gt;Mainly useful in WHERE clause of a query&amp;lt;/remarks&amp;gt;
            Public Enum ConditionalOperator As Integer
                EqualTo = 1
                NotEqualTo = 2
                GreaterThan = 3
                Lessthan = 4
                GreaterThanEqualTo = 5
                LessThanEqualTo = 6
                StringLike = 7
                StringNotLike = 8
            End Enum

#End Region

#Region &amp;quot;Variables&amp;quot;



            Private strColumnName As String
            Private objColumnType As OleDbType
            Private objColumnValue As Object
            Private enmColumnCondition As ConditionalOperator
            Private objDirection As ParameterDirection
            Private intSize As Integer
            Private blnIsNullable As Boolean

#End Region

#Region &amp;quot;Properties&amp;quot;

            ''' &amp;lt;summary&amp;gt;
            ''' Gets or sets the conditional operator used to compare a value of a column
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;Any value as ConditionalOperator enum&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;ConditionalOperator&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property ColumnConditionalOperator() As ConditionalOperator
                Get
                    Return enmColumnCondition
                End Get
                Set(ByVal value As ConditionalOperator)
                    enmColumnCondition = value
                End Set
            End Property

            ''' &amp;lt;summary&amp;gt;
            ''' Gets or sets data type of the column
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;Any OleDbType&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;OleDbType&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property DbType() As OleDbType
                Get
                    Return objColumnType
                End Get
                Set(ByVal value As OleDbType)
                    objColumnType = value
                End Set
            End Property

            ''' &amp;lt;summary&amp;gt;
            ''' Gets or sets the data size defined for the column
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;Size of the column as integer&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;Column size as integer&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property Size() As Integer
                Get
                    Return intSize
                End Get
                Set(ByVal value As Integer)
                    intSize = value
                End Set
            End Property

            ''' &amp;lt;summary&amp;gt;
            ''' Gets or sets the name of the source column
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;Name of the column as string&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;Name of the column as string&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property SourceColumn() As String
                Get
                    Return strColumnName
                End Get
                Set(ByVal value As String)
                    strColumnName = value
                End Set
            End Property

            ''' &amp;lt;summary&amp;gt;
            ''' Gets or sets the value of the column
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;Value of the column as object&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;Object&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property Value() As Object
                Get
                    Return objColumnValue
                End Get
                Set(ByVal Value As Object)
                    objColumnValue = Value
                End Set
            End Property

            ''' &amp;lt;summary&amp;gt;
            ''' Gets or sets whether a column can be null or not null
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;Any boolean value&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;Boolean&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property IsNullable() As Boolean
                Get
                    Return blnIsNullable
                End Get
                Set(ByVal value As Boolean)
                    blnIsNullable = value
                End Set
            End Property

#End Region

        End Class

    End Namespace

End Namespace&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/8d4Q2EoQU6Q" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/8d4Q2EoQU6Q/979c27dd-6a66-4b5d-b602-b5510b785405.aspx</link>
      <pubDate>Mon, 26 Nov 2012 04:22:40 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/979c27dd-6a66-4b5d-b602-b5510b785405.aspx</feedburner:origLink></item>
    <item>
      <title>SQLDB wrapper</title>
      <description>Description: .net class to connect and manipulate sql server database&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/ff1d213d-5ed5-4f74-801f-6aefcb8bf299.aspx'&gt;http://www.codekeep.net/snippets/ff1d213d-5ed5-4f74-801f-6aefcb8bf299.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;''''Option of Inline queries is given in this version 3.2.2
''''Newly Added Functions/Properties/Enums
''''Functions: SetConnectionTimeOut, ExecuteNonQuery, GetDataTable
''''Properties: ConnectionTimeout, ConnectionString
''''Enums: DBCommandType
''''Modified Functions: GetDataSet, GetReader, ExecuteScalar

Imports System
Imports System.IO
Imports System.Xml
Imports System.Data.Common
Imports System.Text
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlTypes
Imports System.Data.SqlClient
Imports System.Windows.Forms

Namespace DataAccess

    Namespace SQL
        ''' &amp;lt;summary&amp;gt;
        ''' Provides methods for manipulating SQL database
        ''' &amp;lt;/summary&amp;gt;
        ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
        Public Class SQLDBWrapper


#Region &amp;quot;Enumerations&amp;quot;
            ''' &amp;lt;summary&amp;gt;
            ''' Type of command to be set to the Command object
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Enum DBCommandType As Integer
                Text = CommandType.Text
                StoredProcedure = CommandType.StoredProcedure
            End Enum
#End Region

#Region &amp;quot;Variables&amp;quot;

            Private colTempParam As New List(Of SqlParameter) 'To hold parameters of stored procedure
            Private Command As SqlCommand = Nothing
            Private _CommandTimeout As Integer = 30
            Private _ConnectionTimeout As Integer = 120
            Private strConnectionString As String = String.Empty
            Private strOriginalConectionString As String = String.Empty

#End Region

#Region &amp;quot;Properties&amp;quot;
            ''' &amp;lt;summary&amp;gt;
            ''' Gets or sets the wait time for executing the command before terminating the 
            ''' attempt to execute a command and generating an error. Default timeout is 30 seconds.
            ''' A value of 0 indicates no limit which must be avoided.
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;Timeout in seconds&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property CommandTimeout() As Integer
                Get
                    Return _CommandTimeout
                End Get
                Set(ByVal value As Integer)
                    _CommandTimeout = value
                End Set
            End Property

            ''' &amp;lt;summary&amp;gt;
            ''' Gets or Sets the ConnectionTimeout property which specifies the amount of time (in seconds) 
            ''' that the server waits before disconnecting an inactive connection. 
            ''' Specify a value between 1 and 65535.
            ''' If a value outside of this range is specified, IIS uses the default of 120 seconds.
            ''' A value of 0 indicates no limit which must be avoided.
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Property ConnectionTimeout() As Integer
                Get
                    Return _ConnectionTimeout
                End Get
                Set(ByVal value As Integer)
                    _ConnectionTimeout = value
                End Set
            End Property

            ''' &amp;lt;summary&amp;gt;
            ''' Gets the Connection String for the current connection
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;value&amp;gt;&amp;lt;/value&amp;gt;
            ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public ReadOnly Property ConnectionString() As String
                Get
                    Return strConnectionString
                End Get
            End Property

#End Region

#Region &amp;quot;Constructors&amp;quot;

            ''' &amp;lt;summary&amp;gt;
            ''' Creates a connection for a given connection string or connection string name as in config file.
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;Connection&amp;quot;&amp;gt;Connection string name as in configuration file or actual connection string&amp;lt;/param&amp;gt;
            ''' &amp;lt;remarks&amp;gt;Constuctor takes both Connection String Name or Connection String&amp;lt;/remarks&amp;gt;
            Public Sub New(ByVal Connection As String)
                Dim strCon As String = Connection.Trim()

                Try
                    If strCon.Contains(&amp;quot;Data Source&amp;quot;) Then
                        strConnectionString = strCon
                    Else
                        strConnectionString = ConfigurationManager.ConnectionStrings(strCon).ToString()
                    End If
                    strOriginalConectionString = strConnectionString

                    SetConnectionTimeOut()
                Catch ex As Exception
                    Throw
                End Try

            End Sub

#End Region

#Region &amp;quot;Functions&amp;quot;

            ''' &amp;lt;summary&amp;gt;
            ''' Executes the stored procedure and returns the output parameters
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;StoredProcedure&amp;quot;&amp;gt;Name of the stored procedure&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;Output Parameters as SortedList(Of String, String)&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function ExecuteProcedure(ByVal StoredProcedure As String) As SortedList(Of String, Object)

                Dim intRowsAffected As Integer
                Dim colReturnValues As New SortedList(Of String, Object)
                Dim objConnection As SqlConnection = Nothing

                Try
                    SetConnectionTimeOut()
                    objConnection = New SqlConnection(strConnectionString)
                    objConnection.Open()

                    Command = New SqlCommand(StoredProcedure, objConnection)

                    With Command
                        .CommandType = CommandType.StoredProcedure
                        .CommandTimeout = Me.CommandTimeout
                    End With


                    If colTempParam.Count &amp;gt; 0 Then
                        Command.Parameters.AddRange(GetDbParam())
                        'Clears the parameters after adding them to 'Command' object
                        colTempParam.Clear()
                    End If

                    intRowsAffected = Command.ExecuteNonQuery()

                    For i As Integer = 0 To Command.Parameters.Count - 1
                        If Command.Parameters(i).Direction = ParameterDirection.Output Then
                            colReturnValues.Add(Command.Parameters(i).ParameterName, Command.Parameters(i).Value)
                        End If
                    Next

                    ' adds return value
                    colReturnValues.Add(&amp;quot;ReturnValue&amp;quot;, intRowsAffected)

                    Return colReturnValues

                Catch ex As Exception
                    Throw
                Finally
                    objConnection.Close()
                    colTempParam.Clear()
                    Command = Nothing
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Executes the Stored Procedure / Query String and returns the rows affected
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;StoredProcedureOrSQLQuery&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function ExecuteNonQuery(ByVal StoredProcedureOrSQLQuery As String, Optional ByVal CmdType As DBCommandType = DBCommandType.StoredProcedure) As SortedList(Of String, Object)
                Dim intRowsAffected As Integer
                Dim colReturnValues As New SortedList(Of String, Object)
                Dim objConnection As SqlConnection = Nothing

                Try
                    SetConnectionTimeOut()
                    objConnection = New SqlConnection(strConnectionString)
                    objConnection.Open()

                    Command = New SqlCommand(StoredProcedureOrSQLQuery, objConnection)

                    With Command
                        .CommandType = CmdType
                        .CommandTimeout = Me.CommandTimeout
                    End With


                    If colTempParam.Count &amp;gt; 0 Then
                        Command.Parameters.AddRange(GetDbParam())
                        'Clears the parameters after adding them to 'Command' object
                        colTempParam.Clear()
                    End If

                    intRowsAffected = Command.ExecuteNonQuery()

                    ' adds return value
                    colReturnValues.Add(&amp;quot;ReturnValue&amp;quot;, intRowsAffected)

                    Return colReturnValues

                Catch ex As Exception
                    Throw
                Finally
                    objConnection.Close()
                    colTempParam.Clear()
                    Command = Nothing
                End Try
            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Returns a dataset by executing the Stored Procedure / Query String
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;StoredProcedureOrSQLQuery&amp;quot;&amp;gt;Name of the stored procedure/ Query String&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;Dataset&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function GetDataSet(ByVal StoredProcedureOrSQLQuery As String, Optional ByVal CmdType As DBCommandType = DBCommandType.StoredProcedure) As DataSet

                Dim Adapter As SqlDataAdapter = Nothing
                Dim ds As New DataSet()
                Dim objConnection As SqlConnection = Nothing

                Try
                    SetConnectionTimeOut()
                    objConnection = New SqlConnection(strConnectionString)

                    Command = New SqlCommand(StoredProcedureOrSQLQuery, objConnection)
                    Command.CommandType = CmdType
                    Command.CommandTimeout = CommandTimeout

                    If colTempParam.Count &amp;gt; 0 Then
                        Command.Parameters.AddRange(GetDbParam())
                        'Clears the parameters after adding them to 'Command' object
                        colTempParam.Clear()
                    End If

                    Adapter = New SqlDataAdapter(Command)
                    Adapter.Fill(ds)
                    Return ds

                Catch ex As Exception
                    Throw
                Finally
                    objConnection.Close()
                    colTempParam.Clear()
                    Command = Nothing
                    Adapter = Nothing
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Returns Datatable from the Stored pProcedure / Query String
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;StoredProcedureOrSQLQuery&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function GetDataTable(ByVal StoredProcedureOrSQLQuery As String, Optional ByVal CmdType As DBCommandType = DBCommandType.StoredProcedure) As DataTable
                Try
                    Return GetDataSet(StoredProcedureOrSQLQuery, CmdType).Tables(0)
                Catch ex As Exception
                    Throw
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Executes the stored procedure / query string and returns the SqlDataReader which needs to be closed explicitly
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;StoredProcedureOrSQLQuery&amp;quot;&amp;gt;Name of the stored procedure or Query String&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;SqlDataReader&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;
            ''' Reader should be explicitly closed after it finishes. 
            ''' Closing the reader causes the connection to be closed and returned to the connection pool.
            ''' &amp;lt;/remarks&amp;gt;
            Public Function GetReader(ByVal StoredProcedureOrSQLQuery As String, Optional ByVal CmdType As DBCommandType = DBCommandType.StoredProcedure) As SqlDataReader
                Dim objConnection As SqlConnection = Nothing
                Try
                    SetConnectionTimeOut()
                    objConnection = New SqlConnection(strConnectionString)
                    objConnection.Open()

                    Command = New SqlCommand(StoredProcedureOrSQLQuery, objConnection)
                    Command.CommandType = CmdType

                    If colTempParam.Count &amp;gt; 0 Then
                        Command.Parameters.AddRange(GetDbParam())
                        'Clears the parameters after adding them to 'Command' object
                        colTempParam.Clear()
                    End If

                    Return Command.ExecuteReader(CommandBehavior.CloseConnection)

                Catch ex As Exception
                    Throw
                Finally
                    colTempParam.Clear()
                    Command = Nothing
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Executes the stored procedure/query string and returns the first column of the first row from the result set
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;StoredProcedureOrSQLQuery&amp;quot;&amp;gt;Name of the stored procedure&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;Object&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function ExecuteScalar(ByVal StoredProcedureOrSQLQuery As String, Optional ByVal CmdType As DBCommandType = DBCommandType.StoredProcedure) As Object
                Dim objConnection As SqlConnection = Nothing

                Try
                    SetConnectionTimeOut()
                    objConnection = New SqlConnection(strConnectionString)
                    objConnection.Open()

                    Command = New SqlCommand(StoredProcedureOrSQLQuery, objConnection)
                    Command.CommandType = CmdType

                    If colTempParam.Count &amp;gt; 0 Then
                        Command.Parameters.AddRange(GetDbParam())
                        'Clears the parameters after adding them to 'Command' object
                        colTempParam.Clear()
                    End If

                    Return Command.ExecuteScalar()

                Catch ex As Exception
                    Throw
                Finally
                    objConnection.Close()
                    colTempParam.Clear()
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Executes the SQL scalar function and returns the value as object
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;FunctionName&amp;quot;&amp;gt;Name of the SQL User-Defined function&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;Object&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function ExecuteScalarFunction(ByVal FunctionName As String) As Object
                Dim strQuery As New StringBuilder(&amp;quot;SELECT &amp;quot; + FunctionName + &amp;quot;(&amp;quot;)
                Dim objConnection As SqlConnection = Nothing

                Try
                    If colTempParam.Count &amp;gt; 0 Then
                        For i As Integer = 0 To colTempParam.Count - 1
                            strQuery.Append(colTempParam.Item(i).ParameterName + &amp;quot;,&amp;quot;)
                        Next
                        strQuery.Remove(strQuery.Length - 1, 1)
                    End If

                    strQuery.Append(&amp;quot;)&amp;quot;)

                    SetConnectionTimeOut()
                    objConnection = New SqlConnection(strConnectionString)
                    objConnection.Open()


                    Command = New SqlCommand(strQuery.ToString(), objConnection)
                    Command.CommandType = CommandType.Text

                    If colTempParam.Count &amp;gt; 0 Then
                        Command.Parameters.AddRange(GetDbParam())
                        'Clears the parameters after adding them to 'Command' object
                        colTempParam.Clear()
                    End If

                    Return Command.ExecuteScalar()

                Catch ex As Exception
                    Throw
                Finally
                    objConnection.Close()
                    colTempParam.Clear()
                    Command = Nothing
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Executes the SQL Table-Valued function and returns the result as dataset
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;FunctionName&amp;quot;&amp;gt;Name of the SQL User-Defined function&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;Dataset&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function ExecuteTableValuedFunction(ByVal FunctionName As String) As DataSet

                Dim strQuery As New StringBuilder(&amp;quot;SELECT * FROM &amp;quot; + FunctionName + &amp;quot;(&amp;quot;)
                Dim Adapter As SqlDataAdapter = Nothing
                Dim ds As New DataSet()
                Dim objConnection As SqlConnection = Nothing

                Try
                    If colTempParam.Count &amp;gt; 0 Then
                        For i As Integer = 0 To colTempParam.Count - 1
                            strQuery.Append(colTempParam.Item(i).ParameterName + &amp;quot;,&amp;quot;)
                        Next
                        strQuery.Remove(strQuery.Length - 1, 1)
                    End If

                    strQuery.Append(&amp;quot;)&amp;quot;)

                    SetConnectionTimeOut()
                    objConnection = New SqlConnection(strConnectionString)


                    Command = New SqlCommand(strQuery.ToString(), objConnection)
                    Command.CommandType = CommandType.Text

                    If colTempParam.Count &amp;gt; 0 Then
                        Command.Parameters.AddRange(GetDbParam())
                        'Clears the parameters after adding them to 'Command' object
                        colTempParam.Clear()
                    End If

                    Adapter = New SqlDataAdapter(Command)
                    Adapter.Fill(ds)
                    Return ds

                Catch ex As Exception
                    Throw
                Finally
                    objConnection.Close()
                    colTempParam.Clear()
                    Command = Nothing
                    Adapter = Nothing
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Converts a dataset to XML format in memory and saves if required.
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;Data&amp;quot;&amp;gt;DataTable&amp;lt;/param&amp;gt;
            ''' &amp;lt;param name=&amp;quot;FilePath&amp;quot;&amp;gt;Path of the file for saving the XML result.&amp;lt;/param&amp;gt;
            ''' &amp;lt;returns&amp;gt;XML as String&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Function ConvertToXml(ByVal Data As DataSet, Optional ByVal FilePath As String = &amp;quot;&amp;quot;) As String

                Try
                    Data.DataSetName = &amp;quot;Root&amp;quot;

                    For Each dc As DataColumn In Data.Tables(0).Columns
                        dc.ColumnMapping = MappingType.Attribute
                    Next

                    Return Data.GetXml()
                Catch ex As Exception
                    Throw
                End Try

            End Function

            ''' &amp;lt;summary&amp;gt;
            ''' Adds a parameter to the parameter collection of the command object
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;param name=&amp;quot;ParamName&amp;quot;&amp;gt;Name of the parameter&amp;lt;/param&amp;gt;
            ''' &amp;lt;param name=&amp;quot;ParamType&amp;quot;&amp;gt;Data type of the parameter&amp;lt;/param&amp;gt;
            ''' &amp;lt;param name=&amp;quot;ParamValue&amp;quot;&amp;gt;Value of the parameter&amp;lt;/param&amp;gt;
            ''' &amp;lt;param name=&amp;quot;ParamDirection&amp;quot;&amp;gt;Direction of the parameter&amp;lt;/param&amp;gt;
            ''' &amp;lt;param name=&amp;quot;ParamSize&amp;quot;&amp;gt;Size of the parameter (0 for input parameter and exact size for output parameter as defined in database)&amp;lt;/param&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Public Sub AddParameter(ByVal ParamName As String, ByVal ParamType As DbType, ByVal ParamValue As Object, _
            ByVal ParamDirection As ParameterDirection, ByVal ParamSize As Integer)
                Dim objParam As New SqlParameter

                ''Added
                If ParamName.StartsWith(&amp;quot;@&amp;quot;) = False Then
                    ParamName = &amp;quot;@&amp;quot; + ParamName
                End If

                With objParam
                    .ParameterName = ParamName
                    .DbType = ParamType

                    If ParamType = DbType.Xml Then
                        .Value = New SqlXml(New XmlTextReader(ParamValue.ToString(), XmlNodeType.Document, Nothing))
                    ElseIf ParamType = DbType.DateTime Or ParamType = DbType.Date Then
                        If (Not IsNothing(ParamValue)) AndAlso (Not ParamValue Is DBNull.Value) AndAlso IsDate(ParamValue) Then
                            .Value = Convert.ToDateTime(ParamValue).ToString(&amp;quot;O&amp;quot;)
                        Else
                            .Value = DBNull.Value
                        End If
                    Else
                        .Value = ParamValue
                    End If

                    .Direction = ParamDirection
                    .Size = ParamSize
                End With

                colTempParam.Add(objParam)

            End Sub

            Public Sub ClearParameters()
                If colTempParam Is Nothing Then Exit Sub
                colTempParam.Clear()
            End Sub

            ''' &amp;lt;summary&amp;gt;
            ''' Internal function for creating a parameter collection
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;returns&amp;gt;DbParameter Array&amp;lt;/returns&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Private Function GetDbParam() As DbParameter()
                Dim colParam(colTempParam.Count - 1) As SqlParameter

                For i As Integer = 0 To colTempParam.Count - 1
                    colParam(i) = colTempParam(i)
                Next

                Dim DbParam() As DbParameter = colParam
                Return DbParam
            End Function

            '''' &amp;lt;summary&amp;gt;
            '''' Sets connection timeout if its not specified in the ConnectionString
            '''' If the connection timeout is there in the string, it will compare and 
            '''' update the max value to the connection string.
            '''' &amp;lt;/summary&amp;gt;
            '''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            'Private Sub SetConnectionTimeOut1()

            '    If strConnectionString.ToLower.Contains(&amp;quot;timeout&amp;quot;) = False Then
            '        If strConnectionString.EndsWith(&amp;quot;;&amp;quot;) = True Then
            '            strConnectionString = strConnectionString.Trim() &amp;amp; &amp;quot;timeout = &amp;quot; &amp;amp; _ConnectionTimeout
            '        Else
            '            strConnectionString = strConnectionString.Trim() &amp;amp; &amp;quot;;timeout = &amp;quot; &amp;amp; _ConnectionTimeout
            '        End If

            '    Else
            '        Dim strConString() As String = strConnectionString.Split(&amp;quot;;&amp;quot;)
            '        For Each str As String In strConString
            '            If str.ToLower.Contains(&amp;quot;timeout&amp;quot;) = True Then
            '                Dim strtimeout() As String = str.Split(&amp;quot;=&amp;quot;)
            '                If strtimeout.Length &amp;gt; 1 Then
            '                    If CInt(strtimeout(1)) &amp;lt; _ConnectionTimeout Then
            '                        strConnectionString = strConnectionString.Trim().Substring(0, strConnectionString.Trim().IndexOf(&amp;quot;timeout&amp;quot;))
            '                        If strConnectionString.EndsWith(&amp;quot;;&amp;quot;) = True Then
            '                            strConnectionString = strConnectionString.Trim() &amp;amp; &amp;quot;Timeout = &amp;quot; &amp;amp; _ConnectionTimeout.ToString()
            '                        Else
            '                            strConnectionString = strConnectionString.Trim() &amp;amp; &amp;quot;;Timeout = &amp;quot; &amp;amp; _ConnectionTimeout.ToString()
            '                        End If

            '                    End If
            '                End If
            '            End If
            '        Next
            '    End If
            'End Sub

            ''' &amp;lt;summary&amp;gt;
            ''' Sets connection timeout if its not specified in the ConnectionString
            ''' If the connection timeout is there in the string, it will compare and 
            ''' update the max value to the connection string.
            ''' &amp;lt;/summary&amp;gt;
            ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
            Private Sub SetConnectionTimeOut()
                Try
                    strConnectionString = strOriginalConectionString

                    If strConnectionString.ToLower.Contains(&amp;quot;timeout&amp;quot;) = False Then
                        If strConnectionString.EndsWith(&amp;quot;;&amp;quot;) = True Then
                            strConnectionString = strConnectionString.Trim() &amp;amp; &amp;quot;timeout = &amp;quot; &amp;amp; _ConnectionTimeout.ToString()
                        Else
                            strConnectionString = strConnectionString.Trim() &amp;amp; &amp;quot;;timeout = &amp;quot; &amp;amp; _ConnectionTimeout.ToString()
                        End If
                    End If
                Catch
                    Throw
                End Try
            End Sub


#End Region

        End Class

    End Namespace

End Namespace
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/KuD54M82JXk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/KuD54M82JXk/ff1d213d-5ed5-4f74-801f-6aefcb8bf299.aspx</link>
      <pubDate>Mon, 26 Nov 2012 04:19:32 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/ff1d213d-5ed5-4f74-801f-6aefcb8bf299.aspx</feedburner:origLink></item>
    <item>
      <title>file manager</title>
      <description>Description: file manager which can be used for loging&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f6af6ddb-c20f-477c-bf5a-3b154e5f7c4a.aspx'&gt;http://www.codekeep.net/snippets/f6af6ddb-c20f-477c-bf5a-3b154e5f7c4a.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Public Class FileManager
    Implements IDisposable

#Region &amp;quot;Global Functions&amp;quot;
    Private sFileName As String

    Public Property FileName() As String
        Get
            Return sFileName
        End Get
        Set(ByVal value As String)
            sFileName = value
        End Set
    End Property

    Public Function FileExists() As Boolean
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        Return My.Computer.FileSystem.FileExists(sFileName)
    End Function
    Public Sub DeleteFile()
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        Call My.Computer.FileSystem.DeleteFile(sFileName)
    End Sub
    Public Sub Close()
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If Not oSR Is Nothing Then oSR.Close()
        If Not oSW Is Nothing Then oSW.Close()
    End Sub

    Public Sub New()

    End Sub
    Public Sub New(ByVal FileName As String)
        sFileName = FileName
    End Sub
#End Region
#Region &amp;quot;Reading Files&amp;quot;
    Private oSR As IO.StreamReader

    Public ReadOnly Property EOF() As Boolean
        Get
            If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
            If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
            If oSR Is Nothing Then Throw New Exception(&amp;quot;File not open for reading&amp;quot;)
            Return oSR.EndOfStream
        End Get
    End Property

    Public Sub OpenTextFileForReading()
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)

        If Not oSR Is Nothing Then
            oSR.Close()
            oSR.Dispose()
            oSR = Nothing
        End If

        oSR = New IO.StreamReader(sFileName)
    End Sub
    Public Function ReadToEndOfFile() As String
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSR Is Nothing Then Throw New Exception(&amp;quot;File not open for reading&amp;quot;)

        Return oSR.ReadToEnd
    End Function
    Public Function ReadLine() As String
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSR Is Nothing Then Throw New Exception(&amp;quot;File not open for reading&amp;quot;)

        Return oSR.ReadLine()
    End Function
    Public Function Read() As Integer
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSR Is Nothing Then Throw New Exception(&amp;quot;File not open for reading&amp;quot;)

        Return oSR.Read()
    End Function
    Public Function Read(ByVal Buffer() As Char, ByVal StartPos As Integer, ByVal Length As Integer) As Integer
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSR Is Nothing Then Throw New Exception(&amp;quot;File not open for reading&amp;quot;)

        Return oSR.Read(Buffer, StartPos, Length)
    End Function
    Public Sub CloseReader()
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSR Is Nothing Then Throw New Exception(&amp;quot;File not open for reading&amp;quot;)

        oSR.Close()
    End Sub
#End Region
#Region &amp;quot;Writing Files&amp;quot;
    Private oSW As IO.StreamWriter

    Public Property AutoFlush() As Boolean
        Get
            If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
            If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
            If oSW Is Nothing Then Throw New Exception(&amp;quot;File not open for writing&amp;quot;)

            Return oSW.AutoFlush
        End Get
        Set(ByVal value As Boolean)
            If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
            If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
            If oSW Is Nothing Then Throw New Exception(&amp;quot;File not open for writing&amp;quot;)

            oSW.AutoFlush = value
        End Set
    End Property

    Public Sub OpenTextFileForWriting()
        Call OpenTextFileForWriting(False)
    End Sub
    Public Sub OpenTextFileForWriting(ByVal bAppend As Boolean)
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)

        If Not oSW Is Nothing Then
            oSW.Flush()
            oSW.Close()
            oSW.Dispose()
            oSW = Nothing
        End If

        oSW = New IO.StreamWriter(sFileName, bAppend)
    End Sub
    Public Sub WriteLine(ByVal InputText As String)
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSW Is Nothing Then Throw New Exception(&amp;quot;File not open for writing&amp;quot;)

        oSW.WriteLine(InputText)
    End Sub
    Public Sub Write(ByVal InputText As String)
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSW Is Nothing Then Throw New Exception(&amp;quot;File not open for writing&amp;quot;)

        oSW.Write(InputText)
    End Sub
    Public Sub Write(ByVal Buffer() As Char)
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSW Is Nothing Then Throw New Exception(&amp;quot;File not open for writing&amp;quot;)

        oSW.Write(Buffer)
    End Sub
    Public Sub WriteMemoryContentsToFile()
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSW Is Nothing Then Throw New Exception(&amp;quot;File not open for writing&amp;quot;)

        oSW.Flush()
    End Sub

    Public Sub CloseWriter()
        If sFileName = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;Filename Not Specified&amp;quot;)
        If Not FileExists() Then Throw New Exception(&amp;quot;File does not exists&amp;quot;)
        If oSW Is Nothing Then Throw New Exception(&amp;quot;File not open for writing&amp;quot;)

        oSW.Close()
    End Sub
#End Region

#Region &amp;quot; IDisposable Support &amp;quot;
    Private disposedValue As Boolean = False        ' To detect redundant calls

    ' IDisposable
    Protected Overridable Sub Dispose(ByVal disposing As Boolean)
        If Not Me.disposedValue Then
            If disposing Then
                ' TODO: free other state (managed objects).
            End If

            ' TODO: free your own state (unmanaged objects).
            ' TODO: set large fields to null.
        End If
        Me.disposedValue = True
    End Sub

    ' This code added by Visual Basic to correctly implement the disposable pattern.
    Public Sub Dispose() Implements IDisposable.Dispose
        ' Do not change this code.  Put cleanup code in Dispose(ByVal disposing As Boolean) above.
        Dispose(True)
    End Sub
#End Region

    Protected Overrides Sub Finalize()
        Me.Close()
        MyBase.Finalize()
    End Sub
End Class
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/Gk_TLQu8S0s" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/Gk_TLQu8S0s/f6af6ddb-c20f-477c-bf5a-3b154e5f7c4a.aspx</link>
      <pubDate>Mon, 26 Nov 2012 04:13:35 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f6af6ddb-c20f-477c-bf5a-3b154e5f7c4a.aspx</feedburner:origLink></item>
    <item>
      <title>advanced text box with spell check functionality</title>
      <description>Description: advanced text box with spell check functionality&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/368cdfdf-84e9-48d9-8a0e-1657136b6002.aspx'&gt;http://www.codekeep.net/snippets/368cdfdf-84e9-48d9-8a0e-1657136b6002.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Imports System.Windows

Public Class AdvancedTextBox
	Private WithEvents wpfTB As System.Windows.Controls.TextBox

	Public Event TBPreviewKeyUp(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs)
	Public Event TBPreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs)

	Public Enum Scrollbar
		Auto = 0
		Disabled = 1
		Hidden = 2
		Visible
	End Enum
	Public Enum AlignText
		Left = 0
		Right = 1
		Center = 2
		Justify = 3
	End Enum
	Public Enum WrapText
		WrapWithOverflow = 0
		NoWrap = 1
		Wrap = 2
	End Enum

	Public Sub New()

		' This call is required by the designer.
		InitializeComponent()

		' Add any initialization after the InitializeComponent() call.

		'Create the text box
		wpfTB = New System.Windows.Controls.TextBox
		wpfTB.SpellCheck.IsEnabled = True
		wpfTB.AcceptsReturn = False
		wpfTB.VerticalScrollBarVisibility = Scrollbar.Hidden
		Me.ctrlHost.Child = wpfTB
	End Sub

	Public Overrides Property BackColor As System.Drawing.Color
		Get
			Return MyBase.BackColor
		End Get
		Set(ByVal value As System.Drawing.Color)
			MyBase.BackColor = value

			Dim oBrush As New Media.SolidColorBrush(Media.Color.FromArgb(value.A, value.R, value.G, value.B))
			wpfTB.Background = oBrush
		End Set
	End Property
	Public Overrides Property ForeColor As System.Drawing.Color
		Get
			Return MyBase.ForeColor
		End Get
		Set(ByVal value As System.Drawing.Color)
			MyBase.ForeColor = value

			Dim oBrush As New Media.SolidColorBrush(Media.Color.FromArgb(value.A, value.R, value.G, value.B))
			wpfTB.Background = oBrush
		End Set
	End Property
	Public Overrides Property Font As System.Drawing.Font
		Get
			Return MyBase.Font
		End Get
		Set(ByVal value As System.Drawing.Font)
			MyBase.Font = value

			Dim oFont As New Media.FontFamily(Font.FontFamily.Name)
			wpfTB.FontFamily = oFont
		End Set
	End Property
	Public Overrides Property Text As String
		Get
			Return wpfTB.Text
		End Get
		Set(ByVal value As String)
			wpfTB.Text = value
		End Set
	End Property

	Public Overloads Property Enabled As Boolean
		Get
			Return wpfTB.IsEnabled
		End Get
		Set(ByVal value As Boolean)
			wpfTB.IsEnabled = value
		End Set
	End Property

	Public Property TextAlignment As AlignText
		Get
			Return wpfTB.TextAlignment
		End Get
		Set(ByVal value As AlignText)
			wpfTB.TextAlignment = value
		End Set
	End Property
	Public Property AutoSpellCheck As Boolean
		Get
			Return wpfTB.SpellCheck.IsEnabled
		End Get
		Set(ByVal value As Boolean)
			wpfTB.SpellCheck.IsEnabled = value
		End Set
	End Property
	Public Property ScrollBars As ScrollBar
		Get
			Return wpfTB.VerticalScrollBarVisibility
		End Get
		Set(ByVal value As ScrollBar)
			wpfTB.VerticalScrollBarVisibility = value
		End Set
	End Property
	Public Property MultiLine As Boolean
		Get
			Return wpfTB.AcceptsReturn
		End Get
		Set(ByVal value As Boolean)
			wpfTB.AcceptsReturn = value
		End Set
	End Property
	Public Property [ReadOnly] As Boolean
		Get
			Return wpfTB.IsReadOnly
		End Get
		Set(ByVal value As Boolean)
			wpfTB.IsReadOnly = value
			wpfTB.IsReadOnlyCaretVisible = True
		End Set
	End Property
	Public Property MaxLength As Integer
		Get
			Return wpfTB.MaxLength
		End Get
		Set(ByVal value As Integer)
			If value &amp;gt; 32767 Then Throw New Exception(&amp;quot;Max length cannot be greater than 32767 charactors&amp;quot;)
			If value &amp;lt; 0 Then Throw New Exception(&amp;quot;Max length cannot be less than 0 charactors&amp;quot;)
			If value = 0 Then value = 32767
			wpfTB.MaxLength = value

		End Set
	End Property
	Public Property WordWrap As WrapText
		Get
			Return wpfTB.TextWrapping
		End Get
		Set(ByVal value As WrapText)
			wpfTB.TextWrapping = value
		End Set
	End Property

	''' &amp;lt;summary&amp;gt;
	''' Checks for any spelling errors in the control, returns true if errors exist
	''' &amp;lt;/summary&amp;gt;
	''' &amp;lt;returns&amp;gt;Boolean&amp;lt;/returns&amp;gt;
	''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
	Public Function CheckSpelling() As Boolean
		Dim bSpellingState As Boolean
		Try
			bSpellingState = wpfTB.SpellCheck.IsEnabled
			wpfTB.SpellCheck.IsEnabled = True

			If wpfTB.GetNextSpellingErrorCharacterIndex(0, System.Windows.Documents.LogicalDirection.Forward) &amp;lt;&amp;gt; -1 Then
				wpfTB.SpellCheck.IsEnabled = bSpellingState
				Return True
			End If

			wpfTB.SpellCheck.IsEnabled = bSpellingState
			Return False

		Catch ex As Exception
			wpfTB.SpellCheck.IsEnabled = bSpellingState
			Throw
		End Try
	End Function

	Private Sub wpfTB_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles wpfTB.PreviewKeyDown
		RaiseEvent TBPreviewKeyDown(sender, e)
	End Sub
	Private Sub wpfTB_PreviewKeyUp(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles wpfTB.PreviewKeyUp
		RaiseEvent TBPreviewKeyUp(sender, e)
	End Sub
End Class
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/6j146pR28Xc" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/6j146pR28Xc/368cdfdf-84e9-48d9-8a0e-1657136b6002.aspx</link>
      <pubDate>Mon, 26 Nov 2012 03:35:48 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/368cdfdf-84e9-48d9-8a0e-1657136b6002.aspx</feedburner:origLink></item>
    <item>
      <title>advanced text box with spell check functionality</title>
      <description>Description: advanced text box with spell check functionality&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/c2781a2d-134f-47c6-93f1-d32402035d70.aspx'&gt;http://www.codekeep.net/snippets/c2781a2d-134f-47c6-93f1-d32402035d70.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Imports System.Windows

Public Class AdvancedTextBox
	Private WithEvents wpfTB As System.Windows.Controls.TextBox

	Public Event TBPreviewKeyUp(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs)
	Public Event TBPreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs)

	Public Enum Scrollbar
		Auto = 0
		Disabled = 1
		Hidden = 2
		Visible
	End Enum
	Public Enum AlignText
		Left = 0
		Right = 1
		Center = 2
		Justify = 3
	End Enum
	Public Enum WrapText
		WrapWithOverflow = 0
		NoWrap = 1
		Wrap = 2
	End Enum

	Public Sub New()

		' This call is required by the designer.
		InitializeComponent()

		' Add any initialization after the InitializeComponent() call.

		'Create the text box
		wpfTB = New System.Windows.Controls.TextBox
		wpfTB.SpellCheck.IsEnabled = True
		wpfTB.AcceptsReturn = False
		wpfTB.VerticalScrollBarVisibility = Scrollbar.Hidden
		Me.ctrlHost.Child = wpfTB
	End Sub

	Public Overrides Property BackColor As System.Drawing.Color
		Get
			Return MyBase.BackColor
		End Get
		Set(ByVal value As System.Drawing.Color)
			MyBase.BackColor = value

			Dim oBrush As New Media.SolidColorBrush(Media.Color.FromArgb(value.A, value.R, value.G, value.B))
			wpfTB.Background = oBrush
		End Set
	End Property
	Public Overrides Property ForeColor As System.Drawing.Color
		Get
			Return MyBase.ForeColor
		End Get
		Set(ByVal value As System.Drawing.Color)
			MyBase.ForeColor = value

			Dim oBrush As New Media.SolidColorBrush(Media.Color.FromArgb(value.A, value.R, value.G, value.B))
			wpfTB.Background = oBrush
		End Set
	End Property
	Public Overrides Property Font As System.Drawing.Font
		Get
			Return MyBase.Font
		End Get
		Set(ByVal value As System.Drawing.Font)
			MyBase.Font = value

			Dim oFont As New Media.FontFamily(Font.FontFamily.Name)
			wpfTB.FontFamily = oFont
		End Set
	End Property
	Public Overrides Property Text As String
		Get
			Return wpfTB.Text
		End Get
		Set(ByVal value As String)
			wpfTB.Text = value
		End Set
	End Property

	Public Overloads Property Enabled As Boolean
		Get
			Return wpfTB.IsEnabled
		End Get
		Set(ByVal value As Boolean)
			wpfTB.IsEnabled = value
		End Set
	End Property

	Public Property TextAlignment As AlignText
		Get
			Return wpfTB.TextAlignment
		End Get
		Set(ByVal value As AlignText)
			wpfTB.TextAlignment = value
		End Set
	End Property
	Public Property AutoSpellCheck As Boolean
		Get
			Return wpfTB.SpellCheck.IsEnabled
		End Get
		Set(ByVal value As Boolean)
			wpfTB.SpellCheck.IsEnabled = value
		End Set
	End Property
	Public Property ScrollBars As ScrollBar
		Get
			Return wpfTB.VerticalScrollBarVisibility
		End Get
		Set(ByVal value As ScrollBar)
			wpfTB.VerticalScrollBarVisibility = value
		End Set
	End Property
	Public Property MultiLine As Boolean
		Get
			Return wpfTB.AcceptsReturn
		End Get
		Set(ByVal value As Boolean)
			wpfTB.AcceptsReturn = value
		End Set
	End Property
	Public Property [ReadOnly] As Boolean
		Get
			Return wpfTB.IsReadOnly
		End Get
		Set(ByVal value As Boolean)
			wpfTB.IsReadOnly = value
			wpfTB.IsReadOnlyCaretVisible = True
		End Set
	End Property
	Public Property MaxLength As Integer
		Get
			Return wpfTB.MaxLength
		End Get
		Set(ByVal value As Integer)
			If value &amp;gt; 32767 Then Throw New Exception(&amp;quot;Max length cannot be greater than 32767 charactors&amp;quot;)
			If value &amp;lt; 0 Then Throw New Exception(&amp;quot;Max length cannot be less than 0 charactors&amp;quot;)
			If value = 0 Then value = 32767
			wpfTB.MaxLength = value

		End Set
	End Property
	Public Property WordWrap As WrapText
		Get
			Return wpfTB.TextWrapping
		End Get
		Set(ByVal value As WrapText)
			wpfTB.TextWrapping = value
		End Set
	End Property

	''' &amp;lt;summary&amp;gt;
	''' Checks for any spelling errors in the control, returns true if errors exist
	''' &amp;lt;/summary&amp;gt;
	''' &amp;lt;returns&amp;gt;Boolean&amp;lt;/returns&amp;gt;
	''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
	Public Function CheckSpelling() As Boolean
		Dim bSpellingState As Boolean
		Try
			bSpellingState = wpfTB.SpellCheck.IsEnabled
			wpfTB.SpellCheck.IsEnabled = True

			If wpfTB.GetNextSpellingErrorCharacterIndex(0, System.Windows.Documents.LogicalDirection.Forward) &amp;lt;&amp;gt; -1 Then
				wpfTB.SpellCheck.IsEnabled = bSpellingState
				Return True
			End If

			wpfTB.SpellCheck.IsEnabled = bSpellingState
			Return False

		Catch ex As Exception
			wpfTB.SpellCheck.IsEnabled = bSpellingState
			Throw
		End Try
	End Function

	Private Sub wpfTB_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles wpfTB.PreviewKeyDown
		RaiseEvent TBPreviewKeyDown(sender, e)
	End Sub
	Private Sub wpfTB_PreviewKeyUp(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles wpfTB.PreviewKeyUp
		RaiseEvent TBPreviewKeyUp(sender, e)
	End Sub
End Class
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/plMtBAL2O-o" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/plMtBAL2O-o/c2781a2d-134f-47c6-93f1-d32402035d70.aspx</link>
      <pubDate>Mon, 26 Nov 2012 03:35:43 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/c2781a2d-134f-47c6-93f1-d32402035d70.aspx</feedburner:origLink></item>
    <item>
      <title>Get geo location from Google maps</title>
      <description>Description: With this subroutine, you can query Google for the geo location of an address.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d715cb20-5d92-4244-aeb1-40971ccf454e.aspx'&gt;http://www.codekeep.net/snippets/d715cb20-5d92-4244-aeb1-40971ccf454e.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;            Dim sResponseText As String, sReturn As String
            sReturn = &amp;quot;none&amp;quot;
            Dim objHttp As Object, sQuery As String
            System.Threading.Thread.Sleep(50)
            sQuery = &amp;quot;http://maps.google.com/maps/geo?q=&amp;quot; &amp;amp; address &amp;amp; &amp;quot;&amp;amp;output=csv&amp;amp;key=AIzaSyB203li36fO-J0ruc17LhqCyGbMpjqXpQE&amp;quot;
            objHttp = CreateObject(&amp;quot;Msxml2.ServerXMLHTTP&amp;quot;)
            objHttp.Open(&amp;quot;GET&amp;quot;, sQuery, False)
            objHttp.send()
            sResponseText = objHttp.ResponseText
            'gsLastLatLongResponseText = sResponseText
            objHttp = Nothing
            If Len(sResponseText) &amp;gt; 0 Then
                If sResponseText = &amp;quot;620,0,0,0&amp;quot; Then
                    'MsgBox(address &amp;amp; &amp;quot; NOT found&amp;quot;)
                    System.Threading.Thread.Sleep(1000)
                End If
                'MsgBox(sResponseText)
            End If
            'txtInfo.Text = address &amp;amp; &amp;quot;  =  &amp;quot; &amp;amp; sResponseText
            'txtInfo.Refresh()
            Return sResponseText
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/uuBN3k0WBXU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/uuBN3k0WBXU/d715cb20-5d92-4244-aeb1-40971ccf454e.aspx</link>
      <pubDate>Fri, 23 Nov 2012 23:49:25 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/d715cb20-5d92-4244-aeb1-40971ccf454e.aspx</feedburner:origLink></item>
    <item>
      <title>xmlviewer</title>
      <description>Description: It is an usercontrol to view xml data with tree view and a detail description view&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/133684b5-783f-4608-a28f-e6c01fa57973.aspx'&gt;http://www.codekeep.net/snippets/133684b5-783f-4608-a28f-e6c01fa57973.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Imports IBM.Data.ApplicationBlocks.db2
Imports IBM.Data.DB2

Public Class XMLViewer

    'Property holders
    Private iTotalNodeCount As Integer
	Private dTreeWidthPercent As Double		'Tree width as percentage of control width
	Private sInputFileXML As String				'XML input file name
	Private sOutputFileHTML As String			'HTML output file name
	Private sTopNodeName As String				'Name of parent node for tree
	Private oNames As New Collection			'Collection of renaming infromation for tags

	Private sXMLOrderInfoSQL As String
	Private sEnvironmentUserName As String
	Private sApplicationID As String

	Private oDB2Conn As DB2Connection = Nothing
	Private oSQLConn As SqlClient.SqlConnection = Nothing
    Private oWebFont As System.Drawing.Font

	'Array of full path names (to allow extra information with tree)
	Dim sFullPath() As String

	Public Property DB2Connection As DB2Connection
		Get
			Return oDB2Conn
		End Get
        Set(ByVal value As DB2Connection)
            oDB2Conn = value
        End Set
	End Property
	Public Property SQLDBConnection As SqlClient.SqlConnection
		Get
			Return oSQLConn
		End Get
		Set(ByVal value As SqlClient.SqlConnection)
			oSQLConn = value
		End Set
	End Property

	Public Overrides Property BackColor As System.Drawing.Color
		Get
			Return MyBase.BackColor
		End Get
		Set(ByVal value As System.Drawing.Color)
			MyBase.BackColor = value
			tvwTagTree.BackColor = BackColor
			lblValue.BackColor = BackColor
		End Set
	End Property
	Public Overrides Property ForeColor As System.Drawing.Color
		Get
			Return MyBase.ForeColor
		End Get
		Set(ByVal value As System.Drawing.Color)
			MyBase.ForeColor = value
			tvwTagTree.ForeColor = ForeColor
			lblValue.ForeColor = ForeColor
		End Set
	End Property
	Public Overrides Property Font As System.Drawing.Font
		Get
			Return MyBase.Font
		End Get
		Set(ByVal value As System.Drawing.Font)
			MyBase.Font = value
			lblValue.Font = Font
            tvwTagTree.Font = Font
            WebFont = value
		End Set
    End Property
    Public Property WebFont As System.Drawing.Font
        Get
            Return oWebFont
        End Get
        Set(ByVal value As System.Drawing.Font)
            oWebFont = value
        End Set
    End Property

	Public Property ApplicationID As String
		Get
			Return sApplicationID
		End Get
		Set(ByVal value As String)
			sApplicationID = value
		End Set
	End Property
	Public Property EnvironmentUserName As String
		Get
			Return sEnvironmentUserName
		End Get
		Set(ByVal value As String)
			sEnvironmentUserName = value
		End Set
	End Property
	Public Property XMLOrderInfoSQL As String
		Get
			Return sXMLOrderInfoSQL
		End Get
		Set(ByVal value As String)
			sXMLOrderInfoSQL = value
		End Set
	End Property
	Public Property TreeWidthPercent As Double
		Get
			Return dTreeWidthPercent
		End Get
		Set(ByVal value As Double)
			If value &amp;lt; 20 OrElse value &amp;gt; 80 Then
				Throw New Exception(&amp;quot;Illegal Tree Width Percentage&amp;quot;)
			Else
				dTreeWidthPercent = value
				ReloadLayout()
			End If
		End Set
	End Property
	Public Property InputFileXML As String
		Get
			Return sInputFileXML
		End Get
		Set(ByVal value As String)
			sInputFileXML = value.Trim
		End Set
	End Property
	Public Property OutputFileHTML As String
		Get
			Return sOutputFileHTML
		End Get
		Set(ByVal value As String)
			sOutputFileHTML = value.Trim
		End Set
	End Property
	Public Property TopNodeName As String
		Get
			Return sTopNodeName
		End Get
		Set(ByVal value As String)
			value = value.Trim
			If value = &amp;quot;&amp;quot; Then
				Throw New Exception(&amp;quot;Top Node must be Named&amp;quot;)
			Else
				sTopNodeName = value.Trim
			End If
		End Set
	End Property

	Public Sub New()

		' This call is required by the designer.
		InitializeComponent()

		' Add any initialization after the InitializeComponent() call.
		TreeWidthPercent = 25
		InputFileXML = &amp;quot;&amp;quot;
		OutputFileHTML = &amp;quot;&amp;quot;
		TopNodeName = &amp;quot;XML&amp;quot;
		XMLOrderInfoSQL = &amp;quot;SELECT XML_FIELD, DESCRIPTION FROM EMS.ACQ_FIELDS WHERE DISPLAY_ORDER &amp;gt; 0 ORDER BY DISPLAY_ORDER&amp;quot;
		oSQLConn = Nothing
		oDB2Conn = Nothing

		Call ReloadLayout()
	End Sub
	Public Sub ReloadLayout()
		Try
			Me.SuspendLayout()

			'Calculate tree position and size
			tvwTagTree.Left = 0
			tvwTagTree.Top = 0
			tvwTagTree.Width = ((Me.Width * TreeWidthPercent) \ 100)
			tvwTagTree.Height = Me.Height - 65

			'Calculate web browser position and size
			webXMLInformation.Left = tvwTagTree.Width + 8
			webXMLInformation.Top = 0
			webXMLInformation.Height = Me.Height
			webXMLInformation.Width = Me.Width - tvwTagTree.Width - 8

			'Calculate label position and size
			lblValue.Left = 0
			lblValue.Top = Me.Height - 57
			lblValue.Height = 57
			lblValue.Width = tvwTagTree.Width

			Me.ResumeLayout()
		Catch ex As Exception
			Throw
		End Try
	End Sub
	Public Sub PrintHTML()
		Try
			'Refresh HTML with no highlighted row
			Call BuildHTML(0)

			'Refresh web browser contents
			Call webXMLInformation.Refresh()

			'Print web browser contents
			Call webXMLInformation.ShowPrintDialog()

		Catch ex As Exception
			Throw
		End Try
	End Sub
	Public Sub AddAlias(ByVal AliasName As String, ByVal Tag As String)
		Try
			'Create new collection if needed
			If oNames Is Nothing Then oNames = New Collection

			'Add new alias
            If Not oNames.Contains(Tag.ToUpper) Then oNames.Add(AliasName, Tag.ToUpper)
		Catch ex As Exception
			Throw
		End Try
	End Sub
	Public Sub RenameXML()
		Try
			Dim oNode As TreeNode
			Dim sFullTag As String
			Dim sNewName As String

			'Prepare array to hold path names
            ReDim sFullPath(iTotalNodeCount)

			'Parse entire tree
            For iCnt As Integer = iTotalNodeCount To 1 Step -1

                'Get node
                oNode = tvwTagTree.Nodes.Find(&amp;quot;Tag&amp;quot; &amp;amp; iCnt.ToString, True)(0)
                'Get full tree name
                sFullTag = oNode.FullPath.Substring(4)

                'Remove top node description
                'sFullTag = sFullTag.Substring(Len(TopNodeName) + 2).ToUpper
                'Store full tree name for ordering later
                sFullPath(iCnt) = sFullTag

                'Set default new name
                sNewName = &amp;quot;(&amp;quot; &amp;amp; oNode.Text &amp;amp; &amp;quot;)&amp;quot;
                'Get replacement name if it exists in the naming collection
                If oNames.Contains(sFullTag.ToUpper) Then sNewName = oNames(sFullTag)

                'Change name in tree
                oNode.Text = sNewName
            Next

        Catch ex As Exception
            Throw
        End Try
	End Sub

	Private Function ProcessXML(ByVal oNodes As Xml.XmlNode, ByRef sCurrentTag As String) As TreeNode
        Try

            Dim oParentNode As New TreeNode(oNodes.Name)
            oParentNode.Name = sCurrentTag


            For Each oNode As Xml.XmlNode In oNodes
                If oNode.Name = &amp;quot;#text&amp;quot; Then
                    oParentNode.Tag &amp;amp;= oNode.Value
                Else
                    iTotalNodeCount += 1
                    sCurrentTag = &amp;quot;Tag&amp;quot; &amp;amp; iTotalNodeCount.ToString
                    Dim oTNode As TreeNode = ProcessXML(oNode, sCurrentTag)
                    oParentNode.Nodes.Add(oTNode)
                End If
            Next

            Return oParentNode
        Catch ex As Exception
            Throw
        End Try
	End Function
	Public Sub ReadXML()
		Try
			Dim sCurrentTag As String = &amp;quot;&amp;quot;

			'Sort file error trapping out
			If InputFileXML = &amp;quot;&amp;quot; Then Throw New Exception(&amp;quot;XML File was not specified&amp;quot;)
			If Not My.Computer.FileSystem.FileExists(InputFileXML) Then Throw New Exception(&amp;quot;XML file not found&amp;quot; &amp;amp; vbCr &amp;amp; vbCr &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;quot; &amp;amp; InputFileXML &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;quot;)
			If InputFileXML.ToUpper = OutputFileHTML.ToUpper Then Throw New Exception(&amp;quot;Input file and Output file are the same file&amp;quot;)

			'Create progress bar
			Dim oPB As New ErrorHandler.HSBCProgressBar
			oPB.CaptionMain = &amp;quot;Loading XML&amp;quot;
			oPB.CaptionDetail = &amp;quot;Reading XML Document&amp;quot;

			'clear the tree
            tvwTagTree.Nodes.Clear()
            iTotalNodeCount = 0
            sCurrentTag = &amp;quot;Tag&amp;quot; &amp;amp; iTotalNodeCount.ToString

			'Add standard top node
			Dim oParentNode As New TreeNode(TopNodeName)
			oParentNode.Name = sCurrentTag

			'Read XML file into TreeView control and update control
			Dim oXML As New Xml.XmlDocument
			oXML.Load(InputFileXML)

			For Each oNode As Xml.XmlNode In oXML.ChildNodes
                If Not oNode Is oXML.FirstChild Then
                    iTotalNodeCount += 1
                    sCurrentTag = &amp;quot;Tag&amp;quot; &amp;amp; iTotalNodeCount.ToString
                    oParentNode.Nodes.Add(ProcessXML(oNode, sCurrentTag))
                End If
			Next

			tvwTagTree.Nodes.Add(oParentNode)

			'to finish rename the xml tags
			oPB.PerformStep(&amp;quot;Renaming Tags&amp;quot;)
			Call RenameXML()

			'Build the first HTML
			oPB.PerformStep(&amp;quot;Building HTML&amp;quot;)
			Call BuildHTML(0)

			'and navigate to it
			oPB.Close()
			oPB = Nothing

			Call webXMLInformation.Navigate(OutputFileHTML)

		Catch ex As Exception
			Throw
		End Try
	End Sub

	Private Sub BuildHTML(ByVal iHighlightTag As Integer)
        Try
            Dim iCnt As Integer = 0
            Dim oDT As New DataTable
            Dim sMatch As String = &amp;quot;&amp;quot;
            Dim sTableRow As String = &amp;quot;&amp;quot;

            'TODO: Get ordering information from database
            If Not oSQLConn Is Nothing Then
                Using oDA As New SqlClient.SqlDataAdapter(XMLOrderInfoSQL, oSQLConn)
                    oDA.Fill(oDT)
                End Using
            ElseIf Not oDB2Conn Is Nothing Then
                Using oDA As New DB2DataAdapter(XMLOrderInfoSQL, oDB2Conn)
                    oDA.Fill(oDT)
                End Using
            End If

            'Open HTML file
            Dim oFMan As New ErrorHandler.FileManager(OutputFileHTML)
            oFMan.OpenTextFileForWriting()
            oFMan.AutoFlush = False

            'Write HTML header lines
            oFMan.WriteLine(&amp;quot;&amp;lt;html&amp;gt;&amp;quot;)
            oFMan.WriteLine(&amp;quot;&amp;lt;body style=&amp;quot;&amp;quot;Font-Family:&amp;quot; &amp;amp; oWebFont.FontFamily.Name &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;gt;&amp;quot;)

            'Add Acquisition identifier of Acq_ID and user name
            oFMan.WriteLine(&amp;quot;&amp;lt;h5&amp;gt; Application ID : &amp;quot; &amp;amp; ApplicationID &amp;amp; &amp;quot; &amp;lt;br&amp;gt; Current User ID : &amp;quot; &amp;amp; EnvironmentUserName &amp;amp; &amp;quot;&amp;lt;/h5&amp;gt;&amp;quot;)

            'Add title
            oFMan.WriteLine(&amp;quot;&amp;lt;h1&amp;gt;&amp;lt;a name=&amp;quot;&amp;quot;Tag&amp;quot; &amp;amp; iCnt.ToString &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;gt;&amp;quot; &amp;amp; TopNodeName &amp;amp; &amp;quot;&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;&amp;quot;)

            'Add table definition to HTML
            oFMan.WriteLine(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;)
            oFMan.WriteMemoryContentsToFile()

            'Loop through each record in the ordering set
            For Each oRow As DataRow In oDT.Rows

                'Set string to xml field to stop continuous recordset access
                sMatch = oRow(&amp;quot;XML_FIELD&amp;quot;).ToString.Trim

                'Check if this record is a section header, denoted by an asterisk at the front of the description
                If oRow(&amp;quot;Description&amp;quot;).ToString.Substring(0, 1) = &amp;quot;*&amp;quot; Then
                    oFMan.WriteLine(&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td COLSPAN=2&amp;gt;&amp;lt;font size=2 color=darkblue&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;&amp;quot; &amp;amp; oRow(&amp;quot;Description&amp;quot;).ToString.Trim.Substring(1, oRow(&amp;quot;Description&amp;quot;).ToString.Trim.Length - 1) &amp;amp; &amp;quot;&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;)
                Else

                    For iCnt = 1 To iTotalNodeCount
                        'Check if node matches
                        If sFullPath(iCnt).ToUpper = sMatch.ToUpper Then

                            Dim oNode As TreeNode = tvwTagTree.Nodes.Find(&amp;quot;Tag&amp;quot; &amp;amp; iCnt.ToString, True)(0)
                            If Not oNode Is Nothing Then

                                'Set highlight color for row
                                sTableRow = IIf(iCnt = iHighlightTag + 1, &amp;quot;&amp;lt;tr valign=center bgcolor=yellow&amp;gt;&amp;quot;, &amp;quot;&amp;lt;tr valign=center&amp;gt;&amp;quot;)

                                Dim sTag As String = &amp;quot;&amp;quot;
                                If Not oNode.Tag Is Nothing Then sTag = oNode.Tag.ToString

                                oFMan.WriteLine(sTableRow &amp;amp; &amp;quot;&amp;lt;td width=50% align=right&amp;gt;&amp;lt;font size=2 color=&amp;quot; &amp;amp; _
                                 IIf(oNode.Nodes.Count = 0, &amp;quot;black&amp;quot;, &amp;quot;darkblue&amp;quot;) &amp;amp; _
                                 &amp;quot;&amp;gt;&amp;lt;a name=&amp;quot;&amp;quot;Tag&amp;quot; &amp;amp; iCnt.ToString &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;gt;&amp;quot; &amp;amp; oNode.Text &amp;amp; _
                                 &amp;quot; :&amp;lt;/a&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td width=50% align=left&amp;gt;&amp;lt;font size=2 color=blue&amp;gt;&amp;quot; &amp;amp; sTag.ToLower &amp;amp; _
                                 &amp;quot;&amp;lt;/font&amp;gt;&amp;amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;)

                                'Don't continue search for this xml field
                                Exit For
                            End If
                        End If
                    Next
                End If
                oFMan.WriteMemoryContentsToFile()
            Next

            'Write HTML footer lines
            oFMan.WriteLine(&amp;quot;&amp;lt;/table&amp;gt;&amp;quot;)
            oFMan.WriteLine(&amp;quot;&amp;lt;/body&amp;gt;&amp;quot;)
            oFMan.WriteLine(&amp;quot;&amp;lt;/html&amp;gt;&amp;quot;)
            oFMan.WriteMemoryContentsToFile()

            'Close HTML file
            oFMan.CloseWriter()
            oFMan.Dispose()

            oFMan = Nothing
            oDT = Nothing

        Catch ex As Exception
            Throw
        End Try
	End Sub
	Private Sub tvwTagTree_NodeMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles tvwTagTree.NodeMouseClick
		Try
			Dim sNodeKey As String
			'Build HTML document with correct highlight
            Call BuildHTML(CInt(Val(e.Node.Name.Substring(3))) - 1)

            'sNodeKey = CInt(Val(e.Node.Name.Substring(3)) + 1).ToString.Trim
            sNodeKey = CInt(Val(e.Node.Name.Substring(3))).ToString.Trim
			sNodeKey = &amp;quot;Tag&amp;quot; &amp;amp; sNodeKey

			'Browse to bookmark
			webXMLInformation.Refresh()
			webXMLInformation.Navigate(OutputFileHTML &amp;amp; &amp;quot;#&amp;quot; &amp;amp; sNodeKey)

			lblValue.Text = e.Node.Tag
		Catch ex As Exception
			Throw
		End Try
	End Sub
	Private Sub XMLViewer_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
		Try
			ReloadLayout()
		Catch ex As Exception
			Throw
		End Try
	End Sub

	Private Function StandardiseEmptyTags(ByVal sXML As String) As String
		'Standardise empty tags by changing &amp;lt;SAMPLE/&amp;gt; to &amp;lt;SAMPLE&amp;gt;&amp;lt;/SAMPLE&amp;gt;

		Try
			Dim iEndPointer As Integer = 0
			Dim iStartPointer As Integer = 0
			Dim sTag As String = &amp;quot;&amp;quot;
			'Check for illegal use of unnamed tags
			If sXML.Contains(&amp;quot;&amp;lt;/&amp;gt;&amp;quot;) Then Throw New Exception(&amp;quot;Illegal XML&amp;quot; &amp;amp; ControlChars.CrLf &amp;amp; ControlChars.CrLf &amp;amp; &amp;quot;Unnamed tag(s) exist&amp;quot;)

			'Find empty tag
			iEndPointer = sXML.IndexOf(&amp;quot;/&amp;gt;&amp;quot;)

			'Loop until all empty tags are changed
			Do While iEndPointer &amp;gt; 0

				'Find start position of tag
				For iStartPointer = iEndPointer To 0 Step -1

					'Check for &amp;lt; not found
					If iStartPointer = 0 Then Throw New Exception(&amp;quot;Illegal XML&amp;quot; &amp;amp; vbCr &amp;amp; vbCr &amp;amp; &amp;quot;&amp;quot;&amp;quot;/&amp;gt;&amp;quot;&amp;quot; without &amp;quot;&amp;quot;&amp;lt;&amp;quot;&amp;quot;&amp;quot;)

					'Check for &amp;lt; found
					If sXML.Substring(iStartPointer, 1) = &amp;quot;&amp;lt;&amp;quot; Then Exit For
				Next

				'Start of tag found, get tag name
				sTag = sXML.Substring(iStartPointer + 1, iEndPointer - iStartPointer - 1) = &amp;quot;&amp;lt;&amp;quot;

				'Modify XML
				sXML = Strings.Left(sXML, iStartPointer) &amp;amp; sTag &amp;amp; &amp;quot;&amp;gt;&amp;lt;/&amp;quot; &amp;amp; sTag &amp;amp; sXML.Substring(iEndPointer + 1)

				'Find next empty tag
				iEndPointer = sXML.IndexOf(&amp;quot;/&amp;gt;&amp;quot;)
			Loop

			'Return update XML
			Return sXML

		Catch ex As Exception
			Throw
		End Try
	End Function

End Class
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/D081gUIBlG0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/D081gUIBlG0/133684b5-783f-4608-a28f-e6c01fa57973.aspx</link>
      <pubDate>Tue, 20 Nov 2012 04:04:35 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/133684b5-783f-4608-a28f-e6c01fa57973.aspx</feedburner:origLink></item>
    <item>
      <title>API SuspendLayout</title>
      <description>Description: 	&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/1ca25ba6-6544-4c06-85b6-e41be82a3cd8.aspx'&gt;http://www.codekeep.net/snippets/1ca25ba6-6544-4c06-85b6-e41be82a3cd8.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;

#Region &amp;quot;Constantes API&amp;quot;	
    Private Const SE_ERR_FNF As Short = 2
    Private Const SE_ERR_PNF As Short = 3
    Private Const SE_ERR_ACCESSDENIED As Short = 5
    Private Const SE_ERR_OOM As Short = 8
    Private Const SE_ERR_DLLNOTFOUND As Short = 32
    Private Const SE_ERR_SHARE As Short = 26
    Private Const SE_ERR_ASSOCINCOMPLETE As Short = 27
    Private Const SE_ERR_DDETIMEOUT As Short = 28
    Private Const SE_ERR_DDEFAIL As Short = 29
    Private Const SE_ERR_DDEBUSY As Short = 30
    Private Const SE_ERR_NOASSOC As Short = 31
    Private Const ERROR_BAD_FORMAT As Short = 11

    'Cursor constants
    Private Const IDC_APPSTARTING As UInt32 = 32650
    Private Const IDC_ARROW As UInt32 = 32512
    Private Const IDC_HAND As UInt32 = 32649
    Private Const IDC_CROSS As UInt32 = 32515
    Private Const IDC_HELP As UInt32 = 32651
    Private Const IDC_IBEAM As UInt32 = 32513
    Private Const IDC_NO As UInt32 = 32648
    Private Const IDC_SIZEALL As UInt32 = 32646
    Private Const IDC_SIZENESW As UInt32 = 32643
    Private Const IDC_SIZENS As UInt32 = 32645
    Private Const IDC_SIZENWSE As UInt32 = 32642
    Private Const IDC_SIZEWE As UInt32 = 32644
    Private Const IDC_UP As UInt32 = 32516
    Private Const IDC_WAIT As UInt32 = 32514
    Private Const SPI_SETCURSORS = 87
    Private Const SPIF_SENDWININICHANGE = &amp;amp;H2
    Private Const SPIF_UPDATEINIFILE = &amp;amp;H1
    Const WM_SETREDRAW As Integer = &amp;amp;HB
    Const WM_USER As Integer = &amp;amp;H400
    Const EM_GETEVENTMASK As Integer = (WM_USER + 59)
    Const EM_SETEVENTMASK As Integer = (WM_USER + 69)


    Private Declare Auto Function SendMessage Lib &amp;quot;user32.dll&amp;quot; _
        (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
#End Region&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/8oLMLhdi7zU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/8oLMLhdi7zU/1ca25ba6-6544-4c06-85b6-e41be82a3cd8.aspx</link>
      <pubDate>Tue, 31 Jul 2012 14:54:21 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/1ca25ba6-6544-4c06-85b6-e41be82a3cd8.aspx</feedburner:origLink></item>
    <item>
      <title>student exam rank</title>
      <description>Description: student exam rank&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/6fe16895-c197-4dc2-80f8-2a43f641e5d2.aspx'&gt;http://www.codekeep.net/snippets/6fe16895-c197-4dc2-80f8-2a43f641e5d2.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Private Sub ExamRank()
        Try
            Dim sql As String = _
       &amp;quot;SELECT student,dense_rank() OVER (ORDER BY percentage DESC) as 'Rank' &amp;quot; &amp;amp; _
       &amp;quot;FROM examresult &amp;quot; &amp;amp; _
       &amp;quot;WHERE acayear='&amp;quot; &amp;amp; academic_year &amp;amp; &amp;quot;' and gcode='&amp;quot; &amp;amp; cmbGrp.SelectedValue &amp;amp; &amp;quot;' and exam='&amp;quot; &amp;amp; cmbTerm.SelectedValue &amp;amp; &amp;quot;' and examtype='1'&amp;quot;
            Dim dt As DataTable = SchoolDB.GetDataTable(sql)
            If Not dt Is Nothing And dt.Rows.Count &amp;gt; 0 Then
                For Each row As DataRow In dt.Rows
                    Dim stid As String = row.Item(&amp;quot;student&amp;quot;)
                    Dim rank As String = row.Item(&amp;quot;rank&amp;quot;)
                    'update rank
                    sql = &amp;quot;UPDATE examresult SET rank='&amp;quot; &amp;amp; rank &amp;amp; &amp;quot;' &amp;quot; &amp;amp; _
                    &amp;quot;WHERE student='&amp;quot; &amp;amp; stid &amp;amp; &amp;quot;' and acayear='&amp;quot; &amp;amp; academic_year &amp;amp; &amp;quot;' and gcode='&amp;quot; &amp;amp; cmbGrp.SelectedValue &amp;amp; &amp;quot;' and exam='&amp;quot; &amp;amp; cmbTerm.SelectedValue &amp;amp; &amp;quot;' and examtype='1'&amp;quot;
                    dt = SchoolDB.GetDataTable(sql)
                Next
            End If
            'MsgBox(&amp;quot;&amp;quot;, MsgBoxStyle.Information)
        Catch ex As Exception

        End Try
       

    End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/s0LrL3-7eBo" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/s0LrL3-7eBo/6fe16895-c197-4dc2-80f8-2a43f641e5d2.aspx</link>
      <pubDate>Wed, 25 Jul 2012 03:35:40 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/6fe16895-c197-4dc2-80f8-2a43f641e5d2.aspx</feedburner:origLink></item>
    <item>
      <title>Shell - determine 32 or 64 bit program</title>
      <description>Description: If the Excel version is 2007 the need to determine the operating system.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/7854a71d-9cb7-464e-b96c-2a21225ee2fc.aspx'&gt;http://www.codekeep.net/snippets/7854a71d-9cb7-464e-b96c-2a21225ee2fc.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Public Sub OpenInstructions()
        Try
            Shell(&amp;quot;C:\Program Files\Microsoft Office\Office11\WINWORD.EXE &amp;quot;&amp;quot;C:\Documents and Settings\&amp;quot; &amp;amp; strUserName &amp;amp; &amp;quot;\Desktop\PIPELINE PROGRAM INSTRUCTIONS1.1.docx&amp;quot;&amp;quot;&amp;quot;, AppWinStyle.NormalFocus)
        Catch ex As Exception
            Try
                Shell(&amp;quot;C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE &amp;quot;&amp;quot;C:\Documents and Settings\&amp;quot; &amp;amp; strUserName &amp;amp; &amp;quot;\Desktop\PIPELINE PROGRAM INSTRUCTIONS1.1.docx&amp;quot;&amp;quot;&amp;quot;, AppWinStyle.NormalFocus)
            Catch ex2 As Exception
                Shell(&amp;quot;C:\Program Files\Microsoft Office\Office12\WINWORD.EXE &amp;quot;&amp;quot;C:\Documents and Settings\&amp;quot; &amp;amp; strUserName &amp;amp; &amp;quot;\Desktop\PIPELINE PROGRAM INSTRUCTIONS1.1.docx&amp;quot;&amp;quot;&amp;quot;, AppWinStyle.NormalFocus)
            End Try
        End Try
 &lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/TOv1ajCtbNM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/TOv1ajCtbNM/7854a71d-9cb7-464e-b96c-2a21225ee2fc.aspx</link>
      <pubDate>Fri, 13 Jul 2012 15:51:23 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/7854a71d-9cb7-464e-b96c-2a21225ee2fc.aspx</feedburner:origLink></item>
    <item>
      <title>Initialise HTTPContext for unit testing</title>
      <description>Description: Creates a HTTPContext.Current for use in unit testing a web app&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/4ccbfe7e-ceb0-40de-bf37-6f6e2e00d749.aspx'&gt;http://www.codekeep.net/snippets/4ccbfe7e-ceb0-40de-bf37-6f6e2e00d749.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;        Dim tw As TextWriter = New StringWriter
        Dim wr As New SimpleWorkerRequest(&amp;quot;/webapp&amp;quot;, &amp;quot;C:\\inetpub\\wwwroot\\webapp\\&amp;quot;, &amp;quot;default.aspx&amp;quot;, &amp;quot;&amp;quot;, tw)

        HttpContext.Current = New HttpContext(wr)

        If HttpContext.Current.Items(&amp;quot;DataContextFactory&amp;quot;) Is Nothing Then
            Dim dc As DataContextFactory = New DataContextFactory(System.Configuration.ConfigurationManager.ConnectionStrings(&amp;quot;EntitiesDataContext&amp;quot;).ConnectionString)
            HttpContext.Current.Items.Add(&amp;quot;DataContextFactory&amp;quot;, dc)
        End If&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/nWf7gYVNKew" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/nWf7gYVNKew/4ccbfe7e-ceb0-40de-bf37-6f6e2e00d749.aspx</link>
      <pubDate>Thu, 05 Jul 2012 04:42:25 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/4ccbfe7e-ceb0-40de-bf37-6f6e2e00d749.aspx</feedburner:origLink></item>
    <item>
      <title>AddHandler</title>
      <description>Description: Using a AddHandler to raise an event - see the ClickOnceEquipmentRental program on the MultiChecking form.

cmdChangeDaysOut_Click event raises a form to change the date and then Enter returns to the MultiCheckin form.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/29005590-2b40-4238-a8a7-16c180f8b527.aspx'&gt;http://www.codekeep.net/snippets/29005590-2b40-4238-a8a7-16c180f8b527.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Private Sub MultipleCheckin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtCheckInDate.Text = Date.Today.ToString(&amp;quot;d&amp;quot;)
        txtCheckInDate.Focus()
        rentals.Clear()
        totals.Clear()
        display.Clear()
        pnl_CheckIn.Hide()
        pnl_Order.Hide()
        AddHandler EnterCheckinDate.CheckinDateEntered, AddressOf Me.CheckinDateEntered
        AddHandler ChangeCheckoutDate.ChangeCheckoutDateEntered, AddressOf Me.ChangeCheckoutDateEntered
        AddHandler ChangeCheckinDate.ChangeCheckinDateEntered, AddressOf Me.ChangeCheckinDateEntered
        AddHandler ChangeSearchCriteria.Changesearch, AddressOf Me.ChangeSearch
        AddHandler ChangeShipTo.ChangeAddressEntered, AddressOf Me.ChangeAddressEntered
        AddHandler ctrlFindForm.ControlfindEntered, AddressOf Me.ControlFindEntered
end sub


    Private Sub cmdChangeDaysOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdChangeDaysOut.Click
        _Yes = MsgBox(&amp;quot;Caution this will change ALL the rental items timeout days. Are you sure?&amp;quot;, MsgBoxStyle.YesNoCancel)
        If _Yes &amp;lt;&amp;gt; MsgBoxResult.Yes Then Exit Sub
        ChangeCheckoutDate.ShowDialog()
    End Sub

'********** the next lines are the class of the form raised on the button click.
Public Class ChangeCheckoutDate
    Delegate Sub ChangeCheckoutDateEnteredHandler(ByVal e As changeCheckoutDateEventArgs)
    Public Event ChangeCheckoutDateEntered As ChangeCheckoutDateEnteredHandler
    Private Sub ChangeCheckoutDate_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

    End Sub
    Private Sub cmd_Enter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_Enter.Click
        Try
            Dim dt As DateTime
            dt = CType(txt_CheckoutDate.Text, DateTime)
            RaiseEvent ChangeCheckoutDateEntered(New changeCheckoutDateEventArgs(dt))
            Me.Close()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    Public Class changeCheckoutDateEventArgs
        Inherits System.EventArgs

        Private _DateEntered As DateTime
        Public Property DateEntered() As DateTime
            Get
                Return Me._DateEntered
            End Get
            Set(ByVal value As DateTime)
                Me._DateEntered = value
            End Set
        End Property
        Sub New()
            MyBase.New()
        End Sub
        Sub New(ByVal dateEntered As DateTime)
            MyBase.New()
            Me._DateEntered = dateEntered
        End Sub
    End Class
    Private Sub ToPicker_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToPicker.ValueChanged
        Dim _from As Date = ToPicker.Text
        txt_CheckoutDate.Text = _from
    End Sub
    Private Sub ChangeCheckoutDate_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If txt_CheckoutDate.Text = &amp;quot;&amp;quot; Then
            txt_CheckoutDate.Text = Date.Today.ToString(&amp;quot;d&amp;quot;)
        End If

    End Sub
End Class&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/iB-zwk1e9MA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/iB-zwk1e9MA/29005590-2b40-4238-a8a7-16c180f8b527.aspx</link>
      <pubDate>Fri, 15 Jun 2012 15:48:23 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/29005590-2b40-4238-a8a7-16c180f8b527.aspx</feedburner:origLink></item>
    <item>
      <title>XML to FTP</title>
      <description>Description: Writing a table in XML to a FTP site&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/23f263bc-320e-4025-abe3-ce7d14513f69.aspx'&gt;http://www.codekeep.net/snippets/23f263bc-320e-4025-abe3-ce7d14513f69.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Imports System.IO
Imports EnterpriseDT.Net.Ftp
Imports Microsoft.VisualBasic    

Private Structure FTPInfo
        Public UserName As String
        Public Password As String
        Public Host As String
    End Structure

Private Sub ExportXML()
        'Dim objDataSet As New System.Data.DataSet(&amp;quot;AmtechToASW&amp;quot;)
        'Dim objXmlDocument As New System.Xml.XmlDocument
        'Dim objCmd As System.Data.OleDb.OleDbDataAdapter
        'Dim str As String
        'Dim openedconn As Boolean = False

        'Try


        'If oledbObjConn.State = ConnectionState.Closed Then
        '    oledbObjConn.Open()
        '    openedconn = True
        'End If
        'str = &amp;quot;SELECT * FROM tblRentalASW&amp;quot;
        'objCmd = New System.Data.OleDb.OleDbDataAdapter(str, oledbObjConn)
        'objCmd.Fill(objDataSet, &amp;quot;tblRentalASW&amp;quot;)

        'str = &amp;quot;SELECT * FROM tblRentalASW&amp;quot;
        'objCmd = New System.Data.OleDb.OleDbDataAdapter(str, oledbObjConn)
        'objCmd.Fill(objDataSet, &amp;quot;tblRentalASW&amp;quot;)

        'oledbObjConn.Close()

        'objXmlDocument.LoadXml(objDataSet.GetXml())

        'If File.Exists(xmlFile) Then
        '    File.Delete(xmlFile)
        'End If
        '    objXmlDocument.Save(xmlFile)
        'Catch ex As Exception
        '    MsgBox(&amp;quot;There was an error: &amp;quot; &amp;amp; ex.Message &amp;amp; ex.StackTrace)
        'Finally
        '    If openedconn Then oledbObjConn.Close()
        'End Try

        'Dim poNum As String
        'Dim jobNum As String
        'Dim filename As String


        Dim str As String
        Dim f As System.IO.File
        Dim fso As System.IO.StreamWriter
        'need to get the customer information for the header            

        If File.Exists(xmlFile) Then
            File.Delete(xmlFile)
        End If

        fso = f.CreateText(xmlFile)

        fso.WriteLine(&amp;quot;&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot; encoding=&amp;quot;&amp;quot;UTF-8&amp;quot;&amp;quot;?&amp;gt;&amp;quot;)
        fso.WriteLine(&amp;quot;&amp;lt;ASWNotifier&amp;gt;&amp;quot;)
        fso.WriteLine(&amp;quot;    &amp;lt;Invoices&amp;gt;&amp;quot;)
        GetInvoices(fso)
        fso.WriteLine(&amp;quot;    &amp;lt;/Invoices&amp;gt;&amp;quot;)
        fso.WriteLine(&amp;quot;&amp;lt;/ASWNotifier&amp;gt;&amp;quot;)
        fso.Close()


    End Sub

    Private Sub GetInvoices(ByRef fso As StreamWriter)
        Dim str As String = &amp;quot;SELECT tblInvoicePerm.*, tblAddress.AddressCode, tblAddress.Address, tblAddress.City, tblAddress.State, tblAddress.Zip, tblAddress.AddressCode, tblAddress.Contact, tblAddress.Phone, tblCustomer.Customer, tblCustomer.RepCode &amp;quot; _
        &amp;amp; &amp;quot; FROM (tblInvoicePerm LEFT JOIN tblAddress ON tblInvoicePerm.AddressCode = tblAddress.AddressCode) &amp;quot; _
        &amp;amp; &amp;quot; LEFT JOIN tblCustomer ON tblInvoicePerm.CustNum = tblCustomer.CustNum;&amp;quot;
        Dim cmd As OleDb.OleDbCommand
        Dim rs As OleDb.OleDbDataReader
        Dim invoice As InvoiceInfo
        Dim invoiceArr As New ArrayList
        Dim openedconn As Boolean = False

        Try
            If oledbObjConn.State = ConnectionState.Closed Then
                oledbObjConn.Open()
                openedconn = True
            End If
            cmd = New OleDb.OleDbCommand(str, oledbObjConn)
            rs = cmd.ExecuteReader()

            While rs.Read
                invoice = New InvoiceInfo
                'Add in all the invoice information for the ship to address
                invoice.invoiceNum = rs(&amp;quot;InvoiceNum&amp;quot;)
                invoice.orderNum = rs(&amp;quot;OrderNum&amp;quot;)
                invoice.customer = rs(&amp;quot;Customer&amp;quot;)
                invoice.invoiceDate = rs(&amp;quot;InvoiceDate&amp;quot;)
                invoice.custNum = rs(&amp;quot;CustNum&amp;quot;)
                invoice.address = rs(&amp;quot;address&amp;quot;)
                invoice.city = rs(&amp;quot;city&amp;quot;)
                invoice.state = rs(&amp;quot;state&amp;quot;)
                invoice.zip = rs(&amp;quot;zip&amp;quot;)
                invoice.phone = rs(&amp;quot;phone&amp;quot;)
                invoice.total = rs(&amp;quot;total&amp;quot;)
                'invoice.contact = rs(&amp;quot;contact&amp;quot;)
                invoiceArr.Add(invoice)
            End While
            rs.Close()

        Catch ex As Exception
            MsgBox(&amp;quot;Error: &amp;quot; &amp;amp; ex.Message &amp;amp; &amp;quot; &amp;quot; &amp;amp; ex.StackTrace)
        Finally
            If openedconn Then oledbObjConn.Close()
        End Try

        For Each invoice In invoiceArr
            fso.WriteLine(&amp;quot;        &amp;lt;invoice&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;InvoiceNum&amp;gt;&amp;quot; &amp;amp; invoice.invoiceNum &amp;amp; &amp;quot;&amp;lt;/InvoiceNum&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;OrderNum&amp;gt;&amp;quot; &amp;amp; invoice.orderNum &amp;amp; &amp;quot;&amp;lt;/OrderNum&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;Customer&amp;gt;&amp;quot; &amp;amp; invoice.customer &amp;amp; &amp;quot;&amp;lt;/Customer&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;InvoiceDate&amp;gt;&amp;quot; &amp;amp; invoice.invoiceDate &amp;amp; &amp;quot;&amp;lt;/InvoiceDate&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;CustNum&amp;gt;&amp;quot; &amp;amp; invoice.custNum &amp;amp; &amp;quot;&amp;lt;/CustNum&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;total&amp;gt;&amp;quot; &amp;amp; invoice.total &amp;amp; &amp;quot;&amp;lt;/total&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;addresscode&amp;gt;&amp;quot; &amp;amp; invoice.addressCode &amp;amp; &amp;quot;&amp;lt;/addresscode&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;address&amp;gt;&amp;quot; &amp;amp; invoice.address &amp;amp; &amp;quot;&amp;lt;/address&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;city&amp;gt;&amp;quot; &amp;amp; invoice.city &amp;amp; &amp;quot;&amp;lt;/city&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;state&amp;gt;&amp;quot; &amp;amp; invoice.state &amp;amp; &amp;quot;&amp;lt;/state&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;zip&amp;gt;&amp;quot; &amp;amp; invoice.zip &amp;amp; &amp;quot;&amp;lt;/zip&amp;gt;&amp;quot;)
            'fso.WriteLine(&amp;quot;            &amp;lt;contact&amp;gt;&amp;quot; &amp;amp; invoice.contact &amp;amp; &amp;quot;&amp;lt;/contact&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;phone&amp;gt;&amp;quot; &amp;amp; invoice.phone &amp;amp; &amp;quot;&amp;lt;/phone&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;repairAmount&amp;gt;&amp;quot; &amp;amp; invoice.repairAmount &amp;amp; &amp;quot;&amp;lt;/repairAmount&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;lostAmount&amp;gt;&amp;quot; &amp;amp; invoice.lostAmount &amp;amp; &amp;quot;&amp;lt;/lostAmount&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;            &amp;lt;lines&amp;gt;&amp;quot;)
            GetLines(fso, invoice)
            fso.WriteLine(&amp;quot;            &amp;lt;/lines&amp;gt;&amp;quot;)
            fso.WriteLine(&amp;quot;        &amp;lt;/invoice&amp;gt;&amp;quot;)
        Next
    End Sub

    Private Sub GetLines(ByRef fso As StreamWriter, ByVal invoice As InvoiceInfo)
        Dim str As String = &amp;quot;SELECT * FROM tblRentalPERM WHERE (InvoiceNum = '&amp;quot; &amp;amp; invoice.invoiceNum &amp;amp; &amp;quot;')&amp;quot;
        Dim cmd As OleDb.OleDbCommand
        Dim rs As OleDb.OleDbDataReader
        Dim openedconn As Boolean = False

        Try
            If oledbObjConn.State = ConnectionState.Closed Then
                oledbObjConn.Open()
                openedconn = True
            End If
            cmd = New OleDb.OleDbCommand(str, oledbObjConn)
            rs = cmd.ExecuteReader()


            While rs.Read
                fso.WriteLine(&amp;quot;                &amp;lt;line&amp;gt;&amp;quot;)
                fso.WriteLine(&amp;quot;                    &amp;lt;BarCode&amp;gt;&amp;quot; &amp;amp; rs(&amp;quot;BarCode&amp;quot;) &amp;amp; &amp;quot;&amp;lt;/BarCode&amp;gt;&amp;quot;)
                fso.WriteLine(&amp;quot;                    &amp;lt;timeOut&amp;gt;&amp;quot; &amp;amp; rs(&amp;quot;timeOut&amp;quot;) &amp;amp; &amp;quot;&amp;lt;/timeOut&amp;gt;&amp;quot;)
                fso.WriteLine(&amp;quot;                    &amp;lt;timeIn&amp;gt;&amp;quot; &amp;amp; rs(&amp;quot;timeIn&amp;quot;) &amp;amp; &amp;quot;&amp;lt;/timeIn&amp;gt;&amp;quot;)
                fso.WriteLine(&amp;quot;                    &amp;lt;NumDays&amp;gt;&amp;quot; &amp;amp; rs(&amp;quot;NumDays&amp;quot;) &amp;amp; &amp;quot;&amp;lt;/NumDays&amp;gt;&amp;quot;)
                fso.WriteLine(&amp;quot;                    &amp;lt;amount&amp;gt;&amp;quot; &amp;amp; rs(&amp;quot;amount&amp;quot;) &amp;amp; &amp;quot;&amp;lt;/amount&amp;gt;&amp;quot;)
                fso.WriteLine(&amp;quot;                    &amp;lt;damaged&amp;gt;&amp;quot; &amp;amp; rs(&amp;quot;damaged&amp;quot;) &amp;amp; &amp;quot;&amp;lt;/damaged&amp;gt;&amp;quot;)
                fso.WriteLine(&amp;quot;                &amp;lt;/line&amp;gt;&amp;quot;)
            End While
            rs.Close()

        Catch ex As Exception
            MsgBox(&amp;quot;Error: &amp;quot; &amp;amp; ex.Message &amp;amp; &amp;quot; &amp;quot; &amp;amp; ex.StackTrace)
        Finally
            If openedconn Then oledbObjConn.Close()
        End Try
    End Sub

    Private Sub SendXMLtoFTP()
        Dim ftp As FTPClient
        Dim info As FTPInfo = GetFTPInfo()

        Try
            ftp = New FTPClient(info.Host)
            ftp.Login(info.UserName, info.Password)
            ftp.ConnectMode = FTPConnectMode.PASV
            ftp.TransferType = FTPTransferType.ASCII
            ftp.ChDir(&amp;quot;/victoryftp/SKRental&amp;quot;)
            ftp.Put(xmlFile, &amp;quot;RentalASWnotifier.xml&amp;quot;)
            ftp.Quit()
        Catch ex As Exception
            MsgBox(&amp;quot;There was an error: &amp;quot; &amp;amp; ex.Message)
        End Try
    End Sub

    Private Function GetFTPInfo() As FTPInfo
        Dim info As New FTPInfo
        Dim openedconn As Boolean
        Try
            If oledbObjConn.State = ConnectionState.Closed Then
                oledbObjConn.Open()
                openedconn = True
            End If
            Dim str As String = &amp;quot;SELECT * FROM tblFTPInfo&amp;quot;
            Dim cmd As New OleDb.OleDbCommand(str, oledbObjConn)
            Dim reader As OleDb.OleDbDataReader = cmd.ExecuteReader()

            If reader.Read() Then
                info.Host = reader(&amp;quot;IPAddress&amp;quot;)
                info.UserName = reader(&amp;quot;UserName&amp;quot;)
                info.Password = reader(&amp;quot;Password&amp;quot;)
            Else
                Throw New Exception(&amp;quot;No data found&amp;quot;)
            End If
        Catch ex As Exception
            MsgBox(&amp;quot;Error retriving FTP info: &amp;quot; &amp;amp; ex.Message &amp;amp; vbCrLf &amp;amp; ex.StackTrace)
        Finally
            If openedconn = True Then oledbObjConn.Close()
        End Try

        Return info
    End Function&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/DxfL7djA4WM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/DxfL7djA4WM/23f263bc-320e-4025-abe3-ce7d14513f69.aspx</link>
      <pubDate>Fri, 15 Jun 2012 14:04:26 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/23f263bc-320e-4025-abe3-ce7d14513f69.aspx</feedburner:origLink></item>
    <item>
      <title>Finding File Properties</title>
      <description>Description: Finding the last write time for a file along with pothers&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/5b5e8633-0ef8-4393-9436-a465ed078422.aspx'&gt;http://www.codekeep.net/snippets/5b5e8633-0ef8-4393-9436-a465ed078422.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Private Function ImportDate()
        Dim objFileInfo As New FileInfo(&amp;quot;C:\Documents and Settings\tbaggett\Desktop\XXDR606057_VP.xls&amp;quot;)

        Dim dtLastWriteTime As DateTime = objFileInfo.LastWriteTime

        Return dtLastWriteTime
    End Function&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/LMueEU08_uc" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/LMueEU08_uc/5b5e8633-0ef8-4393-9436-a465ed078422.aspx</link>
      <pubDate>Tue, 08 May 2012 10:52:22 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/5b5e8633-0ef8-4393-9436-a465ed078422.aspx</feedburner:origLink></item>
    <item>
      <title>Creating a shortcut with hotkeys</title>
      <description>Description: Requires Imports IWshRuntimeLibrary and COM reference Windows Script Host Object&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/7c9a70ec-ccde-48ae-bc45-7e5cb878ff33.aspx'&gt;http://www.codekeep.net/snippets/7c9a70ec-ccde-48ae-bc45-7e5cb878ff33.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Public Sub CreateShortcut()
        Dim shell As WshShell = New WshShellClass 'Create new instance
        Dim shortcut As WshShortcut = shell.CreateShortcut(&amp;quot;C:\Documents and Settings\tbaggett\Desktop\RunDatasheet.lnk&amp;quot;) 'Path of the Shortcut - Where the Shortcut should be placed
        shortcut.TargetPath = &amp;quot;C:\Program Files\Victory Packaging\Pipeline\RunDatasheet.exe&amp;quot; 'Exe of shortcut
        shortcut.IconLocation = &amp;quot;C:\Program Files\Victory Packaging\Pipeline\RunDatasheet.exe,0&amp;quot; 'It's icon to use
        'shortcut.RelativePath = &amp;quot;C:\Program Files\Victory Packaging\Pipeline&amp;quot;
        shortcut.Hotkey = &amp;quot;Ctrl+Alt+S&amp;quot;
        shortcut.Description = &amp;quot;Launches RunDatasheet&amp;quot; 'It's description
        shortcut.Save() 'Save it.

    End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/9W-8f90GqeQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/9W-8f90GqeQ/7c9a70ec-ccde-48ae-bc45-7e5cb878ff33.aspx</link>
      <pubDate>Tue, 24 Apr 2012 14:33:06 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/7c9a70ec-ccde-48ae-bc45-7e5cb878ff33.aspx</feedburner:origLink></item>
    <item>
      <title>Opening a ClickOnce from another ClickOnce</title>
      <description>Description: Also opening a word doc if the ClickOnce isn't installed&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/e1531c17-bda5-4ff9-9853-4f776afd5cb6.aspx'&gt;http://www.codekeep.net/snippets/e1531c17-bda5-4ff9-9853-4f776afd5cb6.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Private Sub cmdMarketByMiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMarketByMiles.Click

        Try
            System.Diagnostics.Process.Start(&amp;quot;C:\Documents and Settings\&amp;quot; &amp;amp; strUserName &amp;amp; &amp;quot;\Start Menu\Programs\Victory Packaging Golden State Container\CloseCall.appref-ms&amp;quot;)
        Catch ex As Exception
            MsgBox(&amp;quot;Please install CloseCall from the web site. You will be redirected there now.&amp;quot;)
            Dim doFirstTimeCloseCallInstructionsExist As Boolean
            doFirstTimeCloseCallInstructionsExist = DoesCloseCallInstructionsExist()

            Try
                Shell(&amp;quot;C:\Program Files\Microsoft Office\Office11\WINWORD.EXE &amp;quot;&amp;quot;C:\Documents and Settings\&amp;quot; &amp;amp; strUserName &amp;amp; &amp;quot;\Desktop\CLOSECALL FIRST TIME SETUP.docx&amp;quot;&amp;quot;&amp;quot;, AppWinStyle.NormalFocus)
            Catch exx As Exception
                Shell(&amp;quot;C:\Program Files\Microsoft Office\Office12\WINWORD.EXE &amp;quot;&amp;quot;C:\Documents and Settings\&amp;quot; &amp;amp; strUserName &amp;amp; &amp;quot;\Desktop\CLOSECALL FIRST TIME SETUP.docx&amp;quot;&amp;quot;&amp;quot;, AppWinStyle.NormalFocus)
            End Try

            System.Diagnostics.Process.Start(&amp;quot;http://www.victorypackagingsa.com/CloseCall&amp;quot;)

        End Try



    End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/X2aDZrXPf7c" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/X2aDZrXPf7c/e1531c17-bda5-4ff9-9853-4f776afd5cb6.aspx</link>
      <pubDate>Tue, 24 Apr 2012 14:28:36 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/e1531c17-bda5-4ff9-9853-4f776afd5cb6.aspx</feedburner:origLink></item>
    <item>
      <title>Running a ClickOnce from another ClickOnce</title>
      <description>Description: This is how you can quit having to keep up with 2 programs with the exact code.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/fe60a58f-ead9-4176-90a3-78a2d689abe5.aspx'&gt;http://www.codekeep.net/snippets/fe60a58f-ead9-4176-90a3-78a2d689abe5.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Private Sub cmdMarketByMiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMarketByMiles.Click

        Try
            System.Diagnostics.Process.Start(&amp;quot;C:\Documents and Settings\&amp;quot; &amp;amp; strUserName &amp;amp; &amp;quot;\Start Menu\Programs\Victory Packaging Golden State Container\CloseCall.appref-ms&amp;quot;)
        Catch ex As Exception
            MsgBox(&amp;quot;Please install CloseCall from the web site.&amp;quot;)
            System.Diagnostics.Process.Start(&amp;quot;http://www.victorypackagingsa.com/CloseCall&amp;quot;)
        End Try
 End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/j7TxWWzwCAE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/j7TxWWzwCAE/fe60a58f-ead9-4176-90a3-78a2d689abe5.aspx</link>
      <pubDate>Mon, 23 Apr 2012 15:36:41 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/fe60a58f-ead9-4176-90a3-78a2d689abe5.aspx</feedburner:origLink></item>
    <item>
      <title>Opening a web page with a button</title>
      <description>Description: How to open a web page with just a button click&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/136813bf-4258-4961-b1b5-a0929abca148.aspx'&gt;http://www.codekeep.net/snippets/136813bf-4258-4961-b1b5-a0929abca148.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; 	Try
            System.Diagnostics.Process.Start(&amp;quot;http://www.victorypackagingsa.com/CloseCall&amp;quot;)
        Catch ex As Exception
            MsgBox(&amp;quot;There was an error: &amp;quot; &amp;amp; ex.Message &amp;amp; ex.StackTrace)
        End Try&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/dA6lRfvFNnU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/dA6lRfvFNnU/136813bf-4258-4961-b1b5-a0929abca148.aspx</link>
      <pubDate>Mon, 23 Apr 2012 13:43:01 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/136813bf-4258-4961-b1b5-a0929abca148.aspx</feedburner:origLink></item>
    <item>
      <title>Outlook Task Loading</title>
      <description>Description: Open a taks in Outlook from a MTGC combo box&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/0ca2794f-e842-45b1-ae8d-8da4720fbe28.aspx'&gt;http://www.codekeep.net/snippets/0ca2794f-e842-45b1-ae8d-8da4720fbe28.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Private Sub Mtgc_Tasks_SelectionChangeCommitted(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Mtgc_Tasks.SelectionChangeCommitted
        Dim _contains As Int16 = 0
        Dim leng As Int16 = 0
        Dim objOutlook As Outlook.Application = New Outlook.Application
        Dim objNS As Outlook.NameSpace
        Dim NewContact As Outlook.ContactItem = objOutlook.CreateItem(Outlook.OlItemType.olContactItem)
        Dim cntr As Integer
        Dim isFound As Boolean

        newContact.FullName = txtContactName.Text
        NewContact.CompanyName = txtCompanyName.Text

        objOutlook = New Outlook.Application
        objNS = objOutlook.Session

        Dim objAddressList As Outlook.MAPIFolder

        objAddressList = objNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)

        Dim objItems As Outlook.Items = objAddressList.Items
        Dim objContact As Outlook.ContactItem
        Dim companyName As String = newContact.CompanyName

        For j As Int16 = 1 To objItems.Count
            Try
                objContact = objItems(j)
                If objContact.FullName = newContact.FullName.Trim And objContact.CompanyName.Trim = newContact.CompanyName.Trim Then
                    isFound = True
                    Dim ns As Outlook.NameSpace
                    Dim tasks As Outlook.Items
                    ns = objOutlook.GetNamespace(&amp;quot;MAPI&amp;quot;)
                    tasks = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderTasks).Items
                    Dim task As Object
                    If tasks.Count &amp;gt; 0 Then
                        taskArr = New List(Of TaskInfo)
                        For Each task In tasks
                            If task.subject = Mtgc_Tasks.SelectedItem.col2 Then
                                'Dim oTsk As Outlook.TaskItem = DirectCast(objOutlook.CreateItem(Outlook.OlItemType.olTaskItem), Outlook.TaskItem)

                                'oTsk.Status = Outlook.OlTaskStatus.olTaskInProgress
                                'oTsk.Subject = task.subject
                                'oTsk.PercentComplete = task.percentComplete
                                'oTsk.StartDate = task.startDate
                                'oTsk.DueDate = task.duedate
                                'oTsk.Importance = task.importance

                                'oTsk.Importance = Outlook.OlImportance.olImportanceHigh

                                task.Display()
                                objOutlook = Nothing
                                task = Nothing
                                Exit For

                            End If
                        Next
                    End If

                    Marshal.ReleaseComObject(objContact)
                    Exit For
                End If
                Marshal.ReleaseComObject(objContact)
                objContact = Nothing
            Catch ex As Exception
                MsgBox(&amp;quot;There was an error: &amp;quot; &amp;amp; ex.Message &amp;amp; ex.StackTrace)
            End Try

        Next
    End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/b2WkOGhOplg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/b2WkOGhOplg/0ca2794f-e842-45b1-ae8d-8da4720fbe28.aspx</link>
      <pubDate>Mon, 26 Mar 2012 14:36:29 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/0ca2794f-e842-45b1-ae8d-8da4720fbe28.aspx</feedburner:origLink></item>
    <item>
      <title>DatagridView CellDoubleClick</title>
      <description>Description: Double clicking on a dgv&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/99e5c1bf-ffe2-41a3-bd62-455b94a6ae34.aspx'&gt;http://www.codekeep.net/snippets/99e5c1bf-ffe2-41a3-bd62-455b94a6ae34.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Private Sub dgv_Contacts_CellDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv_Contacts.CellDoubleClick

        rowSelected = e.RowIndex

        If rowSelected &amp;lt; 0 Then Exit Sub
        Dim sic As String = dgv_Contacts(&amp;quot;primarySic&amp;quot;, rowSelected).Value.ToString()
        Dim custNum As String = dgv_Contacts(&amp;quot;customerNum&amp;quot;, rowSelected).Value.ToString()

    End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/ioCEg1Qz1S8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/ioCEg1Qz1S8/99e5c1bf-ffe2-41a3-bd62-455b94a6ae34.aspx</link>
      <pubDate>Thu, 15 Mar 2012 12:35:12 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/99e5c1bf-ffe2-41a3-bd62-455b94a6ae34.aspx</feedburner:origLink></item>
    <item>
      <title>Cabecera de XML y Agregado.</title>
      <description>Description: Caecera y ejemplo para agergar y crear un documento XML.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/60f081c0-200f-4e0f-b55c-071f899485ef.aspx'&gt;http://www.codekeep.net/snippets/60f081c0-200f-4e0f-b55c-071f899485ef.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;   'Crea el nuevo documento.
  Dim oDocXML As New XDocument 'nuevo XML doc.

  'Declaraci&amp;#243;n de tipo.
  oDocXML.Declaration = New XDeclaration(&amp;quot;1.0&amp;quot;, &amp;quot;utf-8&amp;quot;, &amp;quot;no&amp;quot;)

  'Crea el elemento Main.
  Dim oMainContratos As New XElement(&amp;quot;Contratos&amp;quot;)

  'Crea el elemento sub con sus atributos.
  Dim oSubContrato As New XElement(&amp;quot;Contrato&amp;quot;, New XAttribute() {New XAttribute(&amp;quot;Numero&amp;quot;, cboContrato.Text), New XAttribute(&amp;quot;Cuenta1&amp;quot;, cboCuenta.Text), New XAttribute(&amp;quot;Cuenta2&amp;quot;, &amp;quot;N/A&amp;quot;),
                                                         New XAttribute(&amp;quot;Nombre&amp;quot;, txtNombre.Text), New XAttribute(&amp;quot;Domicilio&amp;quot;, txtDomicilio.Text),
                                                         New XAttribute(&amp;quot;ALadoDe&amp;quot;, txtALadoDe.Text), New XAttribute(&amp;quot;FrenteA&amp;quot;, txtFrenteA.Text), New XAttribute(&amp;quot;EntreCalles&amp;quot;, txtEntreCalles.Text),
                                                         New XAttribute(&amp;quot;Colonia&amp;quot;, cboColonia.Text), New XAttribute(&amp;quot;CP&amp;quot;, txtCP.Text), New XAttribute(&amp;quot;Telefono&amp;quot;, txtTelefono.Text),
                                                         New XAttribute(&amp;quot;Celular&amp;quot;, txtCelular.Text), New XAttribute(&amp;quot;EMail&amp;quot;, txtEmail.Text), New XAttribute(&amp;quot;FachadaDomi&amp;quot;, txtFachadaDomi.Text),
                                                         New XAttribute(&amp;quot;Planta&amp;quot;, sPlanta), New XAttribute(&amp;quot;Zona&amp;quot;, cboZona.Text)})

 'Agrega al sub al main.
  oMainContratos.Add(oSubContrato)

  'Agrega el main al doc.
  oDocXML.Add(oMainContratos)

  'Salva el archivo.
  oDocXML.Save(Application.StartupPath &amp;amp; &amp;quot;\cts\Contrs.bin&amp;quot;)&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/ZQxqdFpKPmM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/ZQxqdFpKPmM/60f081c0-200f-4e0f-b55c-071f899485ef.aspx</link>
      <pubDate>Sat, 18 Feb 2012 21:12:18 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/60f081c0-200f-4e0f-b55c-071f899485ef.aspx</feedburner:origLink></item>
    <item>
      <title>Descargar el Código HTML de una pagina web</title>
      <description>Description: Descargar el Código HTML de una pagina web&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/6b6b453f-af80-4797-874e-1fe14f678941.aspx'&gt;http://www.codekeep.net/snippets/6b6b453f-af80-4797-874e-1fe14f678941.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(&amp;quot;http://www.whatismyip.com/&amp;quot;)
  Dim response As System.Net.HttpWebResponse = request.GetResponse()

  Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())

  Dim sourcecode As String = sr.ReadToEnd()
  TextBox1.Text = sourcecode
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/c2drGK-HSm0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/c2drGK-HSm0/6b6b453f-af80-4797-874e-1fe14f678941.aspx</link>
      <pubDate>Sat, 18 Feb 2012 10:45:32 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/6b6b453f-af80-4797-874e-1fe14f678941.aspx</feedburner:origLink></item>
    <item>
      <title>Outlook Tasks</title>
      <description>Description: Adding tasks to outlook&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/9e080004-e1b9-4f36-a21c-0e511cad442f.aspx'&gt;http://www.codekeep.net/snippets/9e080004-e1b9-4f36-a21c-0e511cad442f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; Private Sub cmdAddTask_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddTask.Click
        Dim oApp As Outlook.Application = New Outlook.Application
        Dim cntr As Integer = 0

        If Process.GetProcessesByName(&amp;quot;OutLook&amp;quot;).Length &amp;lt; 1 Then
            'restarts the Process 
            Process.Start(&amp;quot;OutLook.exe&amp;quot;)
            Do Until Process.GetProcessesByName(&amp;quot;OutLook&amp;quot;).Length &amp;gt;= 1
                cntr += 1
            Loop
        End If

        Dim oTsk As Outlook.TaskItem = DirectCast(oApp.CreateItem(Outlook.OlItemType.olTaskItem), Outlook.TaskItem)

        oTsk.Status = Outlook.OlTaskStatus.olTaskInProgress

        'oTsk.PercentComplete = 0

        'oTsk.Importance = Outlook.OlImportance.olImportanceHigh

        oTsk.Subject = &amp;quot;New task for &amp;quot; &amp;amp; txtCompanyName.Text
        oTsk.Display()
        'oTsk.Save()

        ' Clean up.

        oApp = Nothing

        oTsk = Nothing

    End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBNET/~4/8V-bC3xsnNs" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBNET/~3/8V-bC3xsnNs/9e080004-e1b9-4f36-a21c-0e511cad442f.aspx</link>
      <pubDate>Tue, 14 Feb 2012 16:10:21 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/9e080004-e1b9-4f36-a21c-0e511cad442f.aspx</feedburner:origLink></item>
  </channel>
</rss>
