<?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>Alex Medina &#187; .Net</title>
	<atom:link href="http://alexmedina.net/blog/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexmedina.net/blog</link>
	<description>Mi blog, mis cosas...</description>
	<lastBuildDate>Tue, 22 Jun 2010 08:23:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Personalizar DataMember de DataContract</title>
		<link>http://alexmedina.net/blog/2010/06/22/personalizar-datamember-de-datacontract/</link>
		<comments>http://alexmedina.net/blog/2010/06/22/personalizar-datamember-de-datacontract/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 08:23:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[datacontract]]></category>
		<category><![CDATA[datamember]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/?p=122</guid>
		<description><![CDATA[Os pongo un ejemplo, ya que en ocasiones lo que se quieres es cambiar el nombre por ejemplo de la columna que queremos formar a partir de los datos enviados. Pues bien es tan facil como &#8220;reescribir el atributo Name&#8221;
[DataContract(Name="status")]
public class StatusData
{
    private string _name;
    private string _errorDescription = [...]]]></description>
			<content:encoded><![CDATA[<p>Os pongo un ejemplo, ya que en ocasiones lo que se quieres es cambiar el nombre por ejemplo de la columna que queremos formar a partir de los datos enviados. Pues bien es tan facil como &#8220;reescribir el atributo Name&#8221;</p>
<p>[DataContract(Name="status")]<br />
public class StatusData<br />
{<br />
    private string _name;<br />
    private string _errorDescription = null;</p>
<p>    [DataMember(Name = "name1", Order = 0, EmitDefaultValue=false)]<br />
    public string Name<br />
    {<br />
        get { return _name; }<br />
        set { _name = value; }<br />
    }</p>
<p>    [DataMember(Name = "error", Order = 1, EmitDefaultValue=false)]<br />
    public string Description<br />
    {<br />
        get{ return _errorDescription ;}<br />
        set {_errorDescription =value ;}<br />
    }<br />
&#8230;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2010/06/22/personalizar-datamember-de-datacontract/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problemas con las llamadas AJAX.NET en JSON: {&#8220;d&#8221;:{&#8220;__type&#8221;:&#8221;</title>
		<link>http://alexmedina.net/blog/2010/06/09/problemas-con-las-llamadas-ajax-net-en-json-d__type/</link>
		<comments>http://alexmedina.net/blog/2010/06/09/problemas-con-las-llamadas-ajax-net-en-json-d__type/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 10:31:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[AJAX.NET]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[{"d":{"__type":"]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/?p=112</guid>
		<description><![CDATA[Parece ser que por defecto cuando incluimos una llamada AJAX.NET con un servicio y la serializamos en formato JSON, nos devuelve unos datos que no queremos: {&#8220;d&#8221;:{&#8220;__type&#8221;:&#8221;
Esto es porque puede haber un desbarajuste entre los tipos de datos de JavaScript y .NET y de esta forma se cura en salud&#8230;.
Estos datos nos pueden producir problemas [...]]]></description>
			<content:encoded><![CDATA[<p>Parece ser que por defecto cuando incluimos una llamada AJAX.NET con un servicio y la serializamos en formato JSON, nos devuelve unos datos que no queremos: {&#8220;d&#8221;:{&#8220;__type&#8221;:&#8221;</p>
<p>Esto es porque puede haber un desbarajuste entre los tipos de datos de JavaScript y .NET y de esta forma se cura en salud&#8230;.</p>
<p>Estos datos nos pueden producir problemas por ejemplo si tenemos una estructura de tabla (en mi caso un dataTable con YUI y el Datasource viene con un esquema bien definido. )</p>
<p>Pues bien esto se soluciona haciendo un pequeño ajuste en el webconfig:</p>
<p>1- Configuramos el behaviour como webHttp y no como enableWebScript (sería como por defecto con  {&#8220;d&#8221;:{&#8220;__type&#8221;:&#8221;)</p>
<p><code></p>
<p><behaviors></p>
<p>      <endpointBehaviors></p>
<p>		<behavior name="NOMBREDELSERVICIOAspNetAjaxBehavior"><webHttp/></behavior></p>
<p>      </endpointBehaviors></p>
<p>    </behaviors></p>
<p></code></p>
<p>2- Y registramos el servicio:</p>
<p><services></p>
<p>           <service name="Agromutua.Services.REST.NOMBREDELACLASE"></p>
<p>		  <endpoint address="" behaviorConfiguration="NOMBREDELSERVICIOAspNetAjaxBehavior"  		   binding="webHttpBinding" contract="Agromutua.Services.REST.NOMBREDELACLASE"/></p>
<p></services></p>
<p><serviceHostingEnvironment aspNetCompatibilityEnabled="true"></p>
<p><img src="http://img571.imageshack.us/img571/5220/webc.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2010/06/09/problemas-con-las-llamadas-ajax-net-en-json-d__type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como llamar a métodos del code beside del ASPX con Js</title>
		<link>http://alexmedina.net/blog/2010/05/12/como-llamar-a-metodos-del-code-beside-del-aspx-con-js/</link>
		<comments>http://alexmedina.net/blog/2010/05/12/como-llamar-a-metodos-del-code-beside-del-aspx-con-js/#comments</comments>
		<pubDate>Wed, 12 May 2010 06:49:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[aspx]]></category>
		<category><![CDATA[code beside]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/?p=110</guid>
		<description><![CDATA[1- creamos el metodo Js como normalmente lo hacemos. Ej: dimeHora()
2- lo asignamos a un evento de un boton (o de lo que sea) como normalmente hacemos &#8230; onclick=&#8221;dimeHora&#8221;
3- definimos en el code beside un metodo con  y estatico (Shared)
_
Public Shared Function DameHora() As String
    Return DateTime.Now.ToLongTimeString()
End Function
4- Para utilizarlo debemos [...]]]></description>
			<content:encoded><![CDATA[<p>1- creamos el metodo Js como normalmente lo hacemos. Ej: dimeHora()<br />
2- lo asignamos a un evento de un boton (o de lo que sea) como normalmente hacemos &#8230; onclick=&#8221;dimeHora&#8221;<br />
3- definimos en el code beside un metodo con <WebMethod()> y estatico (Shared)</p>
<p><code><WebMethod()>_<br />
Public Shared Function DameHora() As String<br />
    Return DateTime.Now.ToLongTimeString()<br />
End Function</code></p>
<p>4- Para utilizarlo debemos activar la propiedad EnablePageMethods = True del ScriptManager(manejador de js de ASP.NET). Normalmente este se define en la MasterPage, pero sino se puede hacer un ScriptManager.GetCurrert()<br />
5- Después para llamarlo solo tenemos que utilizar en el js el PageMethods:<br />
PageMethods.DameHora()</p>
<p>Como quedaría el js:<br />
<code>function dimeHora()<br />
{<br />
    PageMethods.DameHora(finLlamada, gestorDeErrores)<br />
}<br />
// finLlamada y gestorDeErrores manejan los resultados si ha ido bien o mal, como ya hacemos</code></p>
<p>Y porque os envio esto?<br />
- No hace falta crear un servicio<br />
- Reduce la carga de servidor, mejora el UpdatePanel que envía toda la información en los autoposback asíncronos<br />
- no hace autoposback<br />
- trabajamos con datos devueltos del método que estamos acostumbrados a trabajar en js (hacer eval)</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2010/05/12/como-llamar-a-metodos-del-code-beside-del-aspx-con-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Error en el inicio de instalación VS2008</title>
		<link>http://alexmedina.net/blog/2010/05/06/error-en-el-inicio-de-instalacion-vs2008/</link>
		<comments>http://alexmedina.net/blog/2010/05/06/error-en-el-inicio-de-instalacion-vs2008/#comments</comments>
		<pubDate>Thu, 06 May 2010 16:15:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[instalación]]></category>
		<category><![CDATA[vs2008]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/?p=108</guid>
		<description><![CDATA[Si al iniciar la instalación de Visual Studio 2008 te produce un error y tienes instalado Microsoft Office 2007&#8230;
tienes la solución aqui¡¡ Se trata del Infopath que trae dicha versión, para desistalarlo solo tienes que ejecutar esto:
msiexec /x {30120000-0044-0C0A-0000-0000000FF1CE}
]]></description>
			<content:encoded><![CDATA[<p>Si al iniciar la instalación de Visual Studio 2008 te produce un error y tienes instalado Microsoft Office 2007&#8230;<br />
tienes la solución aqui¡¡ Se trata del <strong>Infopath </strong>que trae dicha versión, para desistalarlo solo tienes que ejecutar esto:</p>
<p><code>msiexec /x {30120000-0044-0C0A-0000-0000000FF1CE}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2010/05/06/error-en-el-inicio-de-instalacion-vs2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET AJAX UpdatePanel ScriptManager – Dirigir el Foco hacia un Control</title>
		<link>http://alexmedina.net/blog/2010/04/27/asp-net-ajax-updatepanel-scriptmanager-%e2%80%93-dirigir-el-foco-hacia-un-control/</link>
		<comments>http://alexmedina.net/blog/2010/04/27/asp-net-ajax-updatepanel-scriptmanager-%e2%80%93-dirigir-el-foco-hacia-un-control/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 15:03:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Foco]]></category>
		<category><![CDATA[Focus]]></category>
		<category><![CDATA[UpdatePanel]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/?p=102</guid>
		<description><![CDATA[Tradicionalmente cuando queremos dirigir el foco hacia un control hacemos esto:
Control.focus();
PERO si trabajamos con ASP.NET AJAX con un ScriptManager y un UpdatePanel al hacer postback asincrono el UpdatePanel , pierde el foco, para que esto no ocurra insertamos esta linea de codigo para lograr tener el foco donde queramos.
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
scriptManager.SetFocus(CONTROL);
CONTROL = Textbox(Caja de [...]]]></description>
			<content:encoded><![CDATA[<p>Tradicionalmente cuando queremos dirigir el foco hacia un control hacemos esto:</p>
<p><code>Control.focus();</code></p>
<p>PERO si trabajamos con ASP.NET AJAX con un ScriptManager y un UpdatePanel al hacer postback asincrono el UpdatePanel , pierde el foco, para que esto no ocurra insertamos esta linea de codigo para lograr tener el foco donde queramos.</p>
<p><code>ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);</p>
<p>scriptManager.SetFocus(CONTROL);</p>
<p>CONTROL = Textbox(Caja de Texto)</code></p>
<p>Espero los haya ayudado , suerte con sus desarrollos.</p>
<p>PS: el metodo.SetFocus(CONTROL) , tiene como paramentro cualquier tipo de CONTROL ASP.NET asi que podemos usar cualquier CONTROL</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2010/04/27/asp-net-ajax-updatepanel-scriptmanager-%e2%80%93-dirigir-el-foco-hacia-un-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOA: Arquitectura Orientada a Servicios</title>
		<link>http://alexmedina.net/blog/2010/04/07/soa-arquitectura-orientada-a-servicios/</link>
		<comments>http://alexmedina.net/blog/2010/04/07/soa-arquitectura-orientada-a-servicios/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 11:24:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Servicios web]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/?p=99</guid>
		<description><![CDATA[Os dejo un enlace interesante a un whitepaper de Microsoft donde se hace una introducción a la arquitectura SOA, con un ejemplo de guía y unos consejos interesantes.
http://download.microsoft.com/download/c/2/c/c2ce8a3a-b4df-4a12-ba18-7e050aef3364/070717-Real_World_SOA.pdf
]]></description>
			<content:encoded><![CDATA[<p>Os dejo un enlace interesante a un whitepaper de Microsoft donde se hace una introducción a la arquitectura SOA, con un ejemplo de guía y unos consejos interesantes.</p>
<p><a href="http://download.microsoft.com/download/c/2/c/c2ce8a3a-b4df-4a12-ba18-7e050aef3364/070717-Real_World_SOA.pdf">http://download.microsoft.com/download/c/2/c/c2ce8a3a-b4df-4a12-ba18-7e050aef3364/070717-Real_World_SOA.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2010/04/07/soa-arquitectura-orientada-a-servicios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Saltarse&#8221; las Constraints en SQLServer</title>
		<link>http://alexmedina.net/blog/2009/12/01/saltarse-las-constraints-en-sqlserver/</link>
		<comments>http://alexmedina.net/blog/2009/12/01/saltarse-las-constraints-en-sqlserver/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 08:06:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[cosntraints]]></category>
		<category><![CDATA[fk]]></category>
		<category><![CDATA[pk]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/2009/12/01/saltarse-las-constraints-en-sqlserver/</guid>
		<description><![CDATA[Las constraints de una tabla de SQL Server se pueden desactivar temporalmente con la opción NOCHECK CONSTRAINT ALL de ALTER TABLE.
El comando quedaría así:
ALTER TABLE tabla NOCHECK CONSTRAINT ALL;
Con esto se desactivan y puedes hacer la carga de datos sin que te molesten las FK
Después, para volver a activarlas sólo tienes que hacer este otro [...]]]></description>
			<content:encoded><![CDATA[<p>Las constraints de una tabla de SQL Server se pueden desactivar temporalmente con la opción NOCHECK CONSTRAINT ALL de ALTER TABLE.<br />
El comando quedaría así:<br />
ALTER TABLE tabla NOCHECK CONSTRAINT ALL;<br />
Con esto se desactivan y puedes hacer la carga de datos sin que te molesten las FK</p>
<p>Después, para volver a activarlas sólo tienes que hacer este otro ALTER TABLE:<br />
ALTER TABLE tabla WITH CHECK CHECK CONSTRAINT ALL;<br />
Reactiva las constraints chequeando que los datos de las tablas las cumplan</p>
<p>Si quieres volver a habilitarlas sin validar los datos que hayas cargado, aunque no es muy recomendable también se puede hacer:<br />
ALTER TABLE tabla  CHECK CONSTRAINT ALL;</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2009/12/01/saltarse-las-constraints-en-sqlserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entrar en modo administrador en SQL Server 2005</title>
		<link>http://alexmedina.net/blog/2009/11/09/entrar-en-modo-administrador-en-sql-server-2005/</link>
		<comments>http://alexmedina.net/blog/2009/11/09/entrar-en-modo-administrador-en-sql-server-2005/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 12:05:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[cerrar]]></category>
		<category><![CDATA[sesiones]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/2009/11/09/entrar-en-modo-administrador-en-sql-server-2005/</guid>
		<description><![CDATA[Casi todos tenemos el SQL Server con la licencia de 2 usuarios y muchas veces algun compañero se le olvida cerrar la sesión mientras se va ha almorzar&#8230; pues bien&#8230; entra por fuerza bruta¡¡
ejecuta: mstsc /admin
y zas¡¡ dentro en modo administrador&#8230; despues puedes entrar en las tareas del servidor y ver quien esta conectado para [...]]]></description>
			<content:encoded><![CDATA[<p>Casi todos tenemos el SQL Server con la licencia de 2 usuarios y muchas veces algun compañero se le olvida cerrar la sesión mientras se va ha almorzar&#8230; pues bien&#8230; entra por fuerza bruta¡¡</p>
<p>ejecuta: mstsc /admin</p>
<p>y zas¡¡ dentro en modo administrador&#8230; despues puedes entrar en las tareas del servidor y ver quien esta conectado para cerrar las sesiones que veas.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2009/11/09/entrar-en-modo-administrador-en-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>¿¡¡ Donde esta la ventana de Inmediato en el Visual Studio ?¡¡</title>
		<link>http://alexmedina.net/blog/2009/08/10/%c2%bf%c2%a1%c2%a1-donde-esta-la-ventana-de-inmediato-en-el-visual-studio-%c2%a1%c2%a1/</link>
		<comments>http://alexmedina.net/blog/2009/08/10/%c2%bf%c2%a1%c2%a1-donde-esta-la-ventana-de-inmediato-en-el-visual-studio-%c2%a1%c2%a1/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 09:46:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[inmediato]]></category>
		<category><![CDATA[ventana]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/2009/08/10/%c2%bf%c2%a1%c2%a1-donde-esta-la-ventana-de-inmediato-en-el-visual-studio-%c2%a1%c2%a1/</guid>
		<description><![CDATA[Buff me he vuelto loco buscando como sacar la ventana de Inmediato en el Visual Studio&#8230;
No te compliques más: CTRL + ALT + I
]]></description>
			<content:encoded><![CDATA[<p>Buff me he vuelto loco buscando como sacar la ventana de Inmediato en el Visual Studio&#8230;</p>
<p>No te compliques más: CTRL + ALT + I</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2009/08/10/%c2%bf%c2%a1%c2%a1-donde-esta-la-ventana-de-inmediato-en-el-visual-studio-%c2%a1%c2%a1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linq to SQL Debug Visualizer, depura facilmente tus consultas LINQ to SQL</title>
		<link>http://alexmedina.net/blog/2009/07/01/linq-to-sql-debug-visualizer-depura-facilmente-tus-consultas-linq-to-sql/</link>
		<comments>http://alexmedina.net/blog/2009/07/01/linq-to-sql-debug-visualizer-depura-facilmente-tus-consultas-linq-to-sql/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 17:18:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[depurar]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/2009/07/01/linq-to-sql-debug-visualizer-depura-facilmente-tus-consultas-linq-to-sql/</guid>
		<description><![CDATA[Using the LINQ to SQL Debug Visualizer
 One of the nice development features that LINQ to SQL supports is the ability to use a &#8220;debug visualizer&#8221; to hover over a LINQ expression while in the VS 2008 debugger and inspect the raw SQL that the ORM will ultimately execute at runtime when evaluating the LINQ query [...]]]></description>
			<content:encoded><![CDATA[<h3><font face="arial" size="2"><u>Using the LINQ to SQL Debug Visualizer</u></font></h3>
<p><font face="arial" size="2"> </font><font face="arial" size="2">One of the nice development features that LINQ to SQL supports is the ability to use a &#8220;debug visualizer&#8221; to hover over a LINQ expression while in the VS 2008 debugger and inspect the raw SQL that the ORM will ultimately execute at runtime when evaluating the LINQ query expression.</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">For example, assume we write the below LINQ query expression code against a set of data model classes:</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2"><img src="http://www.scottgu.com/blogposts/linqtosql3/step3.jpg" /> </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">We could then use the VS 2008 debugger to hover over the &#8220;products&#8221; variable after the query expression has been assigned:</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2"><img src="http://www.scottgu.com/blogposts/linqtosql3/step4.jpg" /> </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">And if we click the small magnifying glass in the expression above, we can launch the LINQ to SQL debug visualizer to inspect the raw SQL that the ORM will execute based on that LINQ query:</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2"><img src="http://www.scottgu.com/blogposts/linqtosql3/step5.jpg" /> </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">If you click the &#8220;Execute&#8221; button, you can even test out the SQL query and see the raw returned results that will be returned from the database:</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2"><img src="http://www.scottgu.com/blogposts/linqtosql3/step6.jpg" /> </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">This obviously makes it super easy to see precisely what SQL query logic LINQ to SQL ORM is doing for you.  </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">You can learn even more about how all this works by reading the <a href="http://weblogs.asp.net/scottgu/archive/2007/06/29/linq-to-sql-part-3-querying-our-database.aspx" target="_blank">Part 3: Querying our Database</a> segment in my LINQ to SQL series above.</font></p>
<p><font face="arial" size="2"> </font></p>
<h3><font face="arial" size="2"><u>How to Install the LINQ to SQL Debug Visualizer</u></font></h3>
<p><font face="arial" size="2"> </font><font face="arial" size="2">The LINQ to SQL Debug Visualizer isn&#8217;t built-in to VS 2008 &#8211; instead it is an add-in that you need to download to use.  You can download a copy of it <a href="http://www.scottgu.com/blogposts/linqquery/SqlServerQueryVisualizer.zip" target="_blank">here</a>.</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">The download contains both a binary .dll assembly version of the visualizer (within the \bin\debug directory below), as well as all of the source code for the visualizer:</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2"><img src="http://www.scottgu.com/blogposts/linqquery/linq1.jpg" /> </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">To install the LINQ to SQL debug visualizer, follow the below steps:</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">1) Shutdown all running versions of Visual Studio 2008 </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">2) Copy the <strong>SqlServerQueryVisualizer.dll</strong> assembly from the <strong>\bin\debug\</strong> directory in the .zip download above into your local <strong>\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers\</strong> directory:</font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2"><img src="http://www.scottgu.com/blogposts/linqquery/linq2.jpg" /> </font></p>
<p><font face="arial" size="2"> </font><font face="arial" size="2">3) Start up Visual Studio 2008 again.  Now when you use the debugger with LINQ to SQL you should be able to hover over LINQ query expressions and inspect their raw SQL (no extra registration is required).</font></p>
]]></content:encoded>
			<wfw:commentRss>http://alexmedina.net/blog/2009/07/01/linq-to-sql-debug-visualizer-depura-facilmente-tus-consultas-linq-to-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
