<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Redaware Limited - Computer Services &#38; Business IT Solutions in Tenbury Wells, Worcestershire &#187; VB.NET</title>
	<atom:link href="http://www.redaware.net/tag/vb-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redaware.net</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 10:49:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>VB.NET Code Snippets: Updating a data source using an event</title>
		<link>http://www.redaware.net/2009/09/vb-net-code-snippets-updating-a-data-source-using-an-event/</link>
		<comments>http://www.redaware.net/2009/09/vb-net-code-snippets-updating-a-data-source-using-an-event/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 13:14:18 +0000</pubDate>
		<dc:creator>tsymonds</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.redaware.net/?p=103</guid>
		<description><![CDATA[You may wish to update a data source using an event. And, this is the code for Update:]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>You may wish to update a data source using an event.</p>
<pre class="brush: vb; title: ; notranslate">
'You need to use FindControl to access control on a  FormView:
Dim FirstName As TextBox = FormView1.FindControl(&quot;FirstNameTextBox&quot;)
Dim LastName As TextBox = FormView1.FindControl(&quot;LastNameTextBox&quot;)
Dim Phone As TextBox = FormView1.FindControl(&quot;PhoneTextBox&quot;)
Dim Email As TextBox = FormView1.FindControl(&quot;EmailTextBox&quot;)
SqlDataSource1.InsertParameters(&quot;FirstName&quot;).DefaultValue = FirstName
SqlDataSource1.InsertParameters(&quot;LastName&quot;).DefaultValue = LastName
SqlDataSource1.InsertParameters(&quot;Phone&quot;).DefaultValue = Phone
SqlDataSource1.InsertParameters(&quot;Email&quot;).DefaultValue = Email
SqlDataSource1.Insert()
</pre>
<p>And, this is the code for Update:</p>
<pre class="brush: vb; title: ; notranslate">
SqlDataSource1.UpdateParameters(&quot;FirstName&quot;).DefaultValue = FirstName
SqlDataSource1.UpdateParameters(&quot;LastName&quot;).DefaultValue = LastName
SqlDataSource1.UpdateParameters(&quot;Phone&quot;).DefaultValue = Phone
SqlDataSource1.UpdateParameters(&quot;Email&quot;).DefaultValue = Email
SqlDataSource1. Update()
</pre>
<div class="shr-publisher-103"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.redaware.net/2009/09/vb-net-code-snippets-updating-a-data-source-using-an-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.NET: Retrieving Active Directory account properties</title>
		<link>http://www.redaware.net/2009/08/vb-net-retrieving-active-directory-account-properties/</link>
		<comments>http://www.redaware.net/2009/08/vb-net-retrieving-active-directory-account-properties/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 08:22:24 +0000</pubDate>
		<dc:creator>tsymonds</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Windows 2003 Server]]></category>

		<guid isPermaLink="false">http://www.redaware.net/?p=61</guid>
		<description><![CDATA[The .NET Framework includes an API called System.DirectoryServices. The sample VB.NET code below shows how to retrieve user account properties from the Active Directory. In order to use System.DirectoryServices classes, you will need to first add a reference to System.DirectoryServices. Imports System.DirectoryServices is required at the very top of your VB.NET code. Replace dc=domain, dc=co, [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>The .NET Framework includes an API called System.DirectoryServices. The sample VB.NET code below shows how to retrieve user account properties from the Active Directory.</p>
<p>In order to use System.DirectoryServices classes, you will need to first add a reference to <strong>System.DirectoryServices</strong>. </p>
<p><strong>Imports System.DirectoryServices</strong> is required at the very top of your VB.NET code.</p>
<pre class="brush: vb; title: ; notranslate">
Function GetUserProperties(ByVal GetUser, ByVal Result)
        Dim objSearch As New DirectorySearcher
        objSearch.SearchRoot = New DirectoryEntry(&quot;LDAP://dc=domain,dc=co,dc=uk&quot;)
        objSearch.Filter = GetUser
        'cn = Full Name, givenName = First name, initials = Middle names, sn = Surname, mail = email address
        objSearch.PropertiesToLoad.AddRange(New String() {&quot;cn&quot;, &quot;giveName&quot;, &quot;initials&quot;, &quot;sn&quot;, &quot;department&quot;, &quot;mail&quot;, &quot;Manager&quot;})
        Dim objResult As SearchResult
        objResult = objSearch.FindOne()
        GetUserProperties = (objResult.Properties(Result)(0))
End Function
</pre>
<p>Replace <strong>dc=domain, dc=co, dc=uk</strong> with your AD settings.</p>
<div class="shr-publisher-61"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.redaware.net/2009/08/vb-net-retrieving-active-directory-account-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

