<?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>TiagoFigueira.com &#187; asp.net</title>
	<atom:link href="http://tiagofigueira.com/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiagofigueira.com</link>
	<description>Web Developer &#38; SysAdmin</description>
	<lastBuildDate>Thu, 24 Jun 2010 01:36:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>The ‘Microsoft.Jet.OLEDB.4.0′ provider is not registered on the local machine.</title>
		<link>http://tiagofigueira.com/the-microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine/484/</link>
		<comments>http://tiagofigueira.com/the-microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine/484/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 16:45:58 +0000</pubDate>
		<dc:creator>tiago</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Jet 64 bits]]></category>
		<category><![CDATA[microsoft jet]]></category>
		<category><![CDATA[The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine]]></category>
		<category><![CDATA[Windows 7 64 bits]]></category>

		<guid isPermaLink="false">http://tiagofigueira.com/?p=484</guid>
		<description><![CDATA[Estava aqui de volta da importação de dados através de ficheiros excel e deparei-me com este erro: Este erro é provocado pelo facto de não existir uma versão do JET para sistemas 64 bits e eu estar a correr o Windows 7 64 bits. A solução, consoante o tipo de aplicações que estamos a desenvolver (winforms, [...]]]></description>
			<content:encoded><![CDATA[<p>Estava aqui de volta da importação de dados através de ficheiros excel e deparei-me com este erro:</p>
<p><a href="http://tiagofigueira.com/wp-content/uploads/2010/06/erro-Microsoft.Jet_.OLEDB_.4.0.jpg"  class="lightview"><img class="size-full wp-image-488 alignnone" title="erro-Microsoft.Jet.OLEDB.4.0" src="http://tiagofigueira.com/wp-content/uploads/2010/06/erro-Microsoft.Jet_.OLEDB_.4.0.jpg" alt="" width="656" height="106" /></a></p>
<p>Este erro é provocado pelo facto de não existir uma versão do JET para sistemas 64 bits e eu estar a correr o Windows 7 64 bits.</p>
<p>A solução, consoante o tipo de aplicações que estamos a desenvolver (winforms, web) é:</p>
<ul>
<li>compilar o projecto para ambientes x86, ou</li>
<li>Permitir que o IIS (Application Pool) corra aplicações em modo 32 bits (solução para o meu caso).</li>
</ul>
<p>Como é que se configura a application pool? Fácil:</p>
<p>&gt; Abrir o <strong>IIS </strong>&gt; de seguida, Navegar até às &#8220;<strong>Applications Pools</strong>&#8221;</p>
<p><a href="http://tiagofigueira.com/wp-content/uploads/2010/06/pools.jpg"  class="lightview"><img class="size-medium wp-image-489 alignnone" title="pools" src="http://tiagofigueira.com/wp-content/uploads/2010/06/pools-300x269.jpg" alt="" width="300" height="269" /></a></p>
<p>&gt; Clicar com o botão direito do rato em cima da application pool responsável por correr a aplicação em que estamos a trabalhar e escolher a opção &#8220;<strong>Advanced Set</strong><strong>tings</strong>&#8220;.</p>
<p><a href="http://tiagofigueira.com/wp-content/uploads/2010/06/pools-advsettings.jpg"  class="lightview"><img class="size-medium wp-image-490 alignnone" title="pools-advsettings" src="http://tiagofigueira.com/wp-content/uploads/2010/06/pools-advsettings-245x300.jpg" alt="" width="245" height="300" /></a></p>
<p>Por fim, colocar o &#8220;<strong>Enable 32-Bit Applications</strong>&#8221; a &#8220;<strong>True</strong>&#8220;.</p>
<p>Problema resolvido <img src='http://tiagofigueira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://tiagofigueira.com/the-microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine/484/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IsNull em VB.NET</title>
		<link>http://tiagofigueira.com/isnull-em-vb-net/435/</link>
		<comments>http://tiagofigueira.com/isnull-em-vb-net/435/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 23:27:32 +0000</pubDate>
		<dc:creator>tiago</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[VB.NET IsNull]]></category>

		<guid isPermaLink="false">http://tiagofigueira.com/?p=435</guid>
		<description><![CDATA[Estava aqui de volta de um site feito em ASP.NET (VB.NET) e estava-me a fazer falta o IsNull do C#. Solução? Utilizar o &#8220;Is Nothing&#8221; Exemplo: If (Not Request.QueryString(&#34;accao&#34;) Is Nothing) Then Response.Write(&#34; A variavel 'accao' = &#34; &#38; Request.QueryString(&#34;accao&#34;)) End If]]></description>
			<content:encoded><![CDATA[<p>Estava aqui de volta de um site feito em ASP.NET (VB.NET) e estava-me a fazer falta o <strong>IsNull </strong>do C#.<br />
Solução? Utilizar o &#8220;<strong>Is Nothing</strong>&#8221; <img src='http://tiagofigueira.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Exemplo:</p>
<pre class="brush: vb;">
If (Not Request.QueryString(&quot;accao&quot;) Is Nothing) Then
   Response.Write(&quot; A variavel 'accao' = &quot; &amp; Request.QueryString(&quot;accao&quot;))
End If
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tiagofigueira.com/isnull-em-vb-net/435/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET &#8211; Ler nome do Utilizador na Active Directory</title>
		<link>http://tiagofigueira.com/asp-net-ler-nome-do-utilizador-na-active-directory/82/</link>
		<comments>http://tiagofigueira.com/asp-net-ler-nome-do-utilizador-na-active-directory/82/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 09:19:41 +0000</pubDate>
		<dc:creator>tiago</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://tiagofigueira.com/?p=82</guid>
		<description><![CDATA[Noutro dia precisei de ir ler o nome dos utilizadores na Active Directory. Fica o resultado: VB.NET Imports System.DirectoryServices Public Class teste Function GetLdapUserName(ByVal login As String) As String Dim oroot As DirectoryEntry = New DirectoryEntry(&#34;LDAP://servidor:porta/DC=xpto,DC=com&#34;, &#34;user&#34;, &#34;password&#34;) Dim osearcher As DirectorySearcher = New DirectorySearcher(oroot) Dim oresult As SearchResultCollection Dim result As SearchResult osearcher.Filter = [...]]]></description>
			<content:encoded><![CDATA[<pre>Noutro dia precisei de ir ler o nome dos utilizadores na Active Directory.
Fica o resultado:

VB.NET
<pre class="brush: vb;">
Imports System.DirectoryServices

Public Class teste
   Function GetLdapUserName(ByVal login As String) As String

    Dim oroot As DirectoryEntry = New DirectoryEntry(&quot;LDAP://servidor:porta/DC=xpto,DC=com&quot;, &quot;user&quot;, &quot;password&quot;)
    Dim osearcher As DirectorySearcher = New DirectorySearcher(oroot)
    Dim oresult As SearchResultCollection
    Dim result As SearchResult

    osearcher.Filter = &quot;(&amp;(cn=&quot; + login + &quot;))&quot; ' filtro de procura
    osearcher.PropertiesToLoad.Add(&quot;displayName&quot;) ' propriedade a ler
    oresult = osearcher.FindAll()

    For Each result In oresult
       If Not result.GetDirectoryEntry.Properties(&quot;displayName&quot;).Value Is Nothing Then
          Return (result.GetDirectoryEntry.Properties(&quot;displayName&quot;).Value)
       End If
    Next

    Return &quot;Não foi possivel obter o seu nome...&quot;

 End Function
End Class
</pre>
<p>Outras propriedades que podem ser lidas na Active Directory:</p>
<pre class="brush: vb;">
  osearcher.PropertiesToLoad.Add(&quot;ou&quot;) ' organizational unit
  osearcher.PropertiesToLoad.Add(&quot;userPrincipalName&quot;) ' login name
  osearcher.PropertiesToLoad.Add(&quot;distinguishedName&quot;) ' distinguised name
  osearcher.PropertiesToLoad.Add(&quot;name&quot;) ' full name
  osearcher.PropertiesToLoad.Add(&quot;givenname&quot;) ' firstname
  osearcher.PropertiesToLoad.Add(&quot;sn&quot;) ' lastname
  osearcher.PropertiesToLoad.Add(&quot;mail&quot;) ' mail
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tiagofigueira.com/asp-net-ler-nome-do-utilizador-na-active-directory/82/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
