<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:snippet="http://codexchange.org/schemas/snippet/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>CodeXchange: New Snippets</title>
    <link>http://www.codexchange.org</link>
    <description>Summary of the latest snippets published on CodeXchange</description>
    <language>en-us</language>
    <copyright>Copyright © CodeXchange, 2004-2006</copyright>
    <generator>CodeXchange RSS Feed Generator v1.0</generator>
    <webMaster>webmaster@codexchange.org</webMaster>
    <lastBuildDate>Sat, 25 May 2013 17:54:18 GMT</lastBuildDate>
    <ttl>20</ttl>
    <dc:language>en-us</dc:language>
    <dc:rights>Copyright © CodeXchange, 2004-2006</dc:rights>
    <dc:date>5/25/2013 5:54:18 PM</dc:date>
    <dc:publisher />
    <dc:creator>CodeXchange RSS Feed Generator v1.0</dc:creator>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=19295dbc-7714-47c1-b3e8-680132e06dc3</guid>
      <title>TDT - GridPage - Page_Init</title>
      <link>/PreviewSnippet.aspx?SnippetID=19295dbc-7714-47c1-b3e8-680132e06dc3</link>
      <description>TDT - GridPage - Page_Init [C#]</description>
      <author>Guss Davey</author>
      <pubDate>Tue, 31 Jul 2012 00:20:12 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=19295dbc-7714-47c1-b3e8-680132e06dc3#comments</comments>
      <category>8c2f06f8-1c90-43ba-b7f6-72416ef60c2b</category>
      <dc:title>TDT - GridPage - Page_Init</dc:title>
      <dc:date>7/31/2012 12:20:12 AM</dc:date>
      <dc:creator>Guss Davey</dc:creator>
      <content:encoded><![CDATA[<pre>        protected void Page_Init(object sender, System.EventArgs e)
        {
            #region Inject various files into header
            // Include the JS for the custom filter jquery slideout -----------------------
            GridPage.InjectJS("Core/JS/jquery.tabSlideOut.v1.3.js", Page, "ts_" + ID);
            // Include the JS for gritter messages -----------------------
            GridPage.InjectJS("Core/JS/jquery.gritter.min.js", Page, "gr_" + ID);
            // Include the JS for validation messages -----------------------
            GridPage.InjectJS("Core/JS/gritter.alerts.js", Page, "ga_" + ID);
            #endregion
        }</pre>]]></content:encoded>
      <snippet:downloads>1</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=7295b1a5-aaec-4cae-91ea-c579fb12f610</guid>
      <title>CustomValitaor</title>
      <link>/PreviewSnippet.aspx?SnippetID=7295b1a5-aaec-4cae-91ea-c579fb12f610</link>
      <description>CustomValitaor [C#]</description>
      <author>zhu xiaowu</author>
      <pubDate>Fri, 13 May 2011 18:01:20 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=7295b1a5-aaec-4cae-91ea-c579fb12f610#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>CustomValitaor</dc:title>
      <dc:date>5/13/2011 6:01:20 PM</dc:date>
      <dc:creator>zhu xiaowu</dc:creator>
      <content:encoded><![CDATA[<pre>fasdfasdfasdfasdfasdf
asdf
asdfasdfasdfasdfads</pre>]]></content:encoded>
      <snippet:downloads>6</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=4aa1b475-6f2f-42da-92f7-ecaa2a5a3dc9</guid>
      <title />
      <link>/PreviewSnippet.aspx?SnippetID=4aa1b475-6f2f-42da-92f7-ecaa2a5a3dc9</link>
      <description> [C#]</description>
      <author>ruairi odonnell</author>
      <pubDate>Wed, 12 Jan 2011 12:53:17 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=4aa1b475-6f2f-42da-92f7-ecaa2a5a3dc9#comments</comments>
      <category>e5dc5661-427e-4d33-8be6-187bd2783223</category>
      <dc:title />
      <dc:date>1/12/2011 12:53:17 PM</dc:date>
      <dc:creator>ruairi odonnell</dc:creator>
      <content:encoded><![CDATA[<pre></pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=ac4ef358-4ea7-42fc-979b-b259e28a0761</guid>
      <title>Get the file extension from a file path or file name</title>
      <link>/PreviewSnippet.aspx?SnippetID=ac4ef358-4ea7-42fc-979b-b259e28a0761</link>
      <description>Get the file extension from a file path or file name [VB.NET]</description>
      <author>Antonio Cosano</author>
      <pubDate>Fri, 17 Sep 2010 05:42:05 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=ac4ef358-4ea7-42fc-979b-b259e28a0761#comments</comments>
      <category>def21cf5-7419-48cb-a8b7-ceb74299c62a</category>
      <dc:title>Get the file extension from a file path or file name</dc:title>
      <dc:date>9/17/2010 5:42:05 AM</dc:date>
      <dc:creator>Antonio Cosano</dc:creator>
      <content:encoded><![CDATA[<pre>Imports Microsoft.Win32
Imports System.IO
' How to call the function
' Get the file extension from a file path or file name
'  -> Dim Extension As String = Path.GetExtension("hello.mp3")
' Get the file type from the extension
' -> Dim FileType = GetFileType(Extension)
Public Shared Function GetFileType(ByVal fileExtension As String) As String
		Dim fileType As String = String.Empty
		'Search all keys under HKEY_CLASSES_ROOT
		For Each subKey As String In Registry.ClassesRoot.GetSubKeyNames()
			If String.IsNullOrEmpty(subKey) Then
				Continue For
			End If
			If subKey.CompareTo(fileExtension) = 0 Then
				'File extension found. Get Default Value
				Dim defaultValue As String = Registry.ClassesRoot.OpenSubKey(subKey).GetValue("").ToString()
				If defaultValue.Length = 0 Then
					'No File Type specified
					Exit For
				End If
				If fileType.Length = 0 Then
					'Get Initial File Type and search for the full File Type Description
					fileType = defaultValue
					fileExtension = fileType
				Else
					'File Type Description found
					If defaultValue.Length > 0 Then
						fileType = defaultValue
					End If
					Exit For
				End If
			End If
		Next
		Return fileType
	End Function</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>VB.NET</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=f93231b1-c681-474b-9d41-9f9cff559d91</guid>
      <title>grab record from db and subtracts it from variable</title>
      <link>/PreviewSnippet.aspx?SnippetID=f93231b1-c681-474b-9d41-9f9cff559d91</link>
      <description>grab record from db and subtracts it from variable [VB.NET]</description>
      <author>Marcus Reed</author>
      <pubDate>Thu, 16 Sep 2010 13:28:58 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=f93231b1-c681-474b-9d41-9f9cff559d91#comments</comments>
      <category>de2012da-757e-4af6-8537-6799adb7bce1</category>
      <dc:title>grab record from db and subtracts it from variable</dc:title>
      <dc:date>9/16/2010 1:28:58 PM</dc:date>
      <dc:creator>Marcus Reed</dc:creator>
      <content:encoded><![CDATA[<pre>        Try
            ' Takes a string from the textbox to find the records source in the database
            Dim aid As String = ArrestIDToolStripTextBox.Text
            Dim cmd As OleDbCommand = New OleDbCommand("SELECT SUM(AmountPaid) FROM tblPayment WHERE ArrestID ='" & aid & "'", con) ' SQL to pull the data from the database
            con.Open() ' open the connection to the database
            Dim amtpaid As Int32 = cmd.ExecuteScalar
            TextBox2.Text = amtpaid
            con.Close()
            Dim x1, x2 As Integer
            x1 = TextBox3.Text  ' Total Fine amount.
            x2 = TextBox2.Text  ' Total amount Paid so far.
            TextBox4.Text = Val(x1) - Val(x2) ' Subtracts the total fine amount from the amount paid to give us the total amount due.
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>VB.NET</snippet:language>
    </item>
  </channel>
</rss>