<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Devigner and Performance Developer</title>
	<atom:link href="http://francorobles.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://francorobles.wordpress.com</link>
	<description>Providing optimum solutions to every organization that I serve.</description>
	<lastBuildDate>Fri, 30 Dec 2011 15:11:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='francorobles.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Devigner and Performance Developer</title>
		<link>http://francorobles.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://francorobles.wordpress.com/osd.xml" title="The Devigner and Performance Developer" />
	<atom:link rel='hub' href='http://francorobles.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Returning Multiple Models in 1 View in ASP.NET MVC3</title>
		<link>http://francorobles.wordpress.com/2011/05/03/returning-multiple-models-in-1-view-in-asp-net-mvc3/</link>
		<comments>http://francorobles.wordpress.com/2011/05/03/returning-multiple-models-in-1-view-in-asp-net-mvc3/#comments</comments>
		<pubDate>Tue, 03 May 2011 14:30:49 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=298</guid>
		<description><![CDATA[Many mvc developers where asking on how to return multiple Models on a single view. Well its not that complex,  and here is how I did it. First : Create the models Second : Create our controller Finally : Access our model through Razor<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=298&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many mvc developers where asking on how to return multiple Models on a single view. Well its not that complex,  and here is how I did it.</p>
<p>First : Create the models</p>
<p><pre class="brush: css;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcProject.Models {
     public class FirstModel : IEnumerable&lt;FirstModel&gt;, IList&lt;FirstModel&gt; {
         public string Title { get; set; }
         public string Message { get; set; }
         ...
     }
     public class SecondModel : IEnumerable&lt;SecondModel&gt;, IList&lt;SecondModel&gt; {
         public string Title { get; set; }
         public string Message { get; set; }
         ...
     }

     /*Strongly typed wrapper model*/
     public class WrapperModel {
          FirstModel firstModel;
          SecondModel secondModel;
          public WrapperModel() {
                 firstModel = new FirstModel();
                 secondModel = new SecondModel();
          }
     }
}
</pre></p>
<p>Second : Create our controller</p>
<p><pre class="brush: css;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MvcProject.Models;

namespace MvcProject.Controllers {
     public class HomeController : Controller {
          public ActionResult Index() {
                WrapperModel wrapperModel = new WrapperModel();
                return View(wrapperModel);
          }
     }
}
</pre></p>
<p>Finally : Access our model through Razor<br />
<pre class="brush: xml;">
@model MvcProject.Models.WrapperModel
&lt;div&gt;
     @{
                foreach (MvcProject.Models.FirstModel fm in ViewData.Model.firstModel) {
                    &lt;div&gt;
                        &lt;div id=&quot;SponsorNameContainer&quot;&gt;@fm.Title&lt;/div&gt;
                        &lt;div id=&quot;SponsorMessageContainer&quot;&gt;@fm.Message&lt;/div&gt;
                    &lt;/div&gt;
                }
            }
&lt;/div&gt;
&lt;div&gt;
     @{
                foreach (MvcProject.Models.SecondModel sm in ViewData.Model.secondModel) {
                    &lt;div&gt;
                        &lt;div id=&quot;SponsorNameContainer&quot;&gt;@sm.Title&lt;/div&gt;
                        &lt;div id=&quot;SponsorMessageContainer&quot;&gt;@sm.Message&lt;/div&gt;
                    &lt;/div&gt;
                }
            }
&lt;/div&gt;

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=298&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2011/05/03/returning-multiple-models-in-1-view-in-asp-net-mvc3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>
	</item>
		<item>
		<title>Patching .net executables with Reflexil.</title>
		<link>http://francorobles.wordpress.com/2010/10/01/patching-net-executables-with-reflexil/</link>
		<comments>http://francorobles.wordpress.com/2010/10/01/patching-net-executables-with-reflexil/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 16:07:54 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tools and Applications]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=287</guid>
		<description><![CDATA[Lost the source code of a .net executable file? What will you do? Instead of searching for the missing piece which was not documented and not hosted in the version control, instead of searching for it in windows explorers for hours when you already know it cant be found, instead of blaming someone for not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=287&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Lost the source code of a .net executable file? What will you do? Instead of searching for the missing piece which was not documented and not hosted in the version control, instead of searching for it in windows explorers for hours when you already know it cant be found, instead of blaming someone for not making a backup of it, go move and use a tool from red gate called the reflector and its add-in called reflexil.</p>
<p>My case was like the above, where someone forgot to make a backup of a running program, which will run forever. Its a windows application where members of a certain promotion are going to swipe their cards to the application and if they are entitled, the standalone application will print a voucher stating that they can claim these and those. The application needs to be updated by certain people monthly, and my boss asked me if there is a way to automate it? I said YES, but the problem is i dont have the source code, only the executable. I said, there has to be a way, and here is how I did it.</p>
<p>First, download these tools:<br />
1. Reflector &#8211; http://www.red-gate.com/products/reflector/<br />
2. Reflexil &#8211; http://sebastien.lebreton.free.fr/reflexil/</p>
<p>Lets setup reflector first.<br />
1. Open reflector.<br />
<a href="http://francorobles.files.wordpress.com/2010/10/1.jpg"><img class="alignnone size-full wp-image-288" title="1" src="http://francorobles.files.wordpress.com/2010/10/1.jpg?w=640&#038;h=260" alt="" width="640" height="260" /></a></p>
<p>2. Add reflexil in the add-ins. Just go to View-&gt;AddIns and add Reflexil.Reflector.dll.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/10/2.jpg"><img class="alignnone size-full wp-image-289" title="2" src="http://francorobles.files.wordpress.com/2010/10/2.jpg?w=640" alt=""   /></a></p>
<p>3.  Load the executable file that you need to patch.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/10/3.jpg"><img class="alignnone size-full wp-image-290" title="3" src="http://francorobles.files.wordpress.com/2010/10/3.jpg?w=640&#038;h=424" alt="" width="640" height="424" /></a></p>
<p>4. Now select the function or method that you want to patch. Right-click on the reflexil pane and select Replace all with code.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/10/4.jpg"><img class="alignnone size-full wp-image-291" title="4" src="http://francorobles.files.wordpress.com/2010/10/4.jpg?w=640&#038;h=414" alt="" width="640" height="414" /></a></p>
<p>5. Now lets make our changes.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/10/5.jpg"><img class="alignnone size-full wp-image-292" title="5" src="http://francorobles.files.wordpress.com/2010/10/5.jpg?w=640&#038;h=359" alt="" width="640" height="359" /></a></p>
<p>Once you did the change, Right-click your loaded assembly and select save as from the context menu.</p>
<p>Now see the lesson? &#8220;Next time, host your code in your version control!.&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/287/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=287&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/10/01/patching-net-executables-with-reflexil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/10/1.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/10/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/10/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/10/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/10/5.jpg" medium="image">
			<media:title type="html">5</media:title>
		</media:content>
	</item>
		<item>
		<title>URL rewrite with encryption for security reasons.</title>
		<link>http://francorobles.wordpress.com/2010/09/06/url-rewrite-with-encryption-for-security-reasons/</link>
		<comments>http://francorobles.wordpress.com/2010/09/06/url-rewrite-with-encryption-for-security-reasons/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 17:15:47 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=271</guid>
		<description><![CDATA[Today I was asked by my friend on how to rewrite a url for security reasons. He added that a geeky person might attempt to do something on the web application. With that in hand, I said, maybe we can try encrypting the string (QueryString) that we append to our original url. And here is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=271&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was asked by my friend on how to rewrite a url for security reasons. He added that a geeky person might attempt to do something on the web application. With that in hand, I said, maybe we can try encrypting the string (QueryString) that we append to our original url. And here is how i did it.</p>
<p>First &#8211; Create the class that encrypts and decrypts our string.</p>
<p><pre class="brush: csharp;">
using System.Text;
using System.Security.Cryptography;

namespace SC.Utility {
     public class Security {

     public static string Encrypt(string toEncrypt, bool useHashing)
        {
            byte[] keyArray;
            byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);

            System.Configuration.AppSettingsReader settingsReader =
                                                new AppSettingsReader();
            // Get the key from config file

            string key = (string)settingsReader.GetValue(&quot;SecurityKey&quot;,
                                                             typeof(String));
            //System.Windows.Forms.MessageBox.Show(key);
            //If hashing use get hashcode regards to your key
            if (useHashing)
            {
                MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
                keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
                //Always release the resources and flush data
                // of the Cryptographic service provide. Best Practice

                hashmd5.Clear();
            }
            else
                keyArray = UTF8Encoding.UTF8.GetBytes(key);

            TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
            //set the secret key for the tripleDES algorithm
            tdes.Key = keyArray;
            //mode of operation. there are other 4 modes.
            //We choose ECB(Electronic code Book)
            tdes.Mode = CipherMode.ECB;
            //padding mode(if any extra byte added)

            tdes.Padding = PaddingMode.PKCS7;

            ICryptoTransform cTransform = tdes.CreateEncryptor();
            //transform the specified region of bytes array to resultArray
            byte[] resultArray =
              cTransform.TransformFinalBlock(toEncryptArray, 0,
              toEncryptArray.Length);
            //Release resources held by TripleDes Encryptor
            tdes.Clear();
            //Return the encrypted data into unreadable string format
            return Convert.ToBase64String(resultArray, 0, resultArray.Length);
        }

     public static string Decrypt(string cipherString, bool useHashing)
        {
            byte[] keyArray;
            //get the byte code of the string

            byte[] toEncryptArray = Convert.FromBase64String(cipherString);

            System.Configuration.AppSettingsReader settingsReader =
                                                new AppSettingsReader();
            //Get your key from config file to open the lock!
            string key = (string)settingsReader.GetValue(&quot;SecurityKey&quot;,
                                                         typeof(String));

            if (useHashing)
            {
                //if hashing was used get the hash code with regards to your key
                MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
                keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
                //release any resource held by the MD5CryptoServiceProvider

                hashmd5.Clear();
            }
            else
            {
                //if hashing was not implemented get the byte code of the key
                keyArray = UTF8Encoding.UTF8.GetBytes(key);
            }

            TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
            //set the secret key for the tripleDES algorithm
            tdes.Key = keyArray;
            //mode of operation. there are other 4 modes. 
            //We choose ECB(Electronic code Book)

            tdes.Mode = CipherMode.ECB;
            //padding mode(if any extra byte added)
            tdes.Padding = PaddingMode.PKCS7;

            ICryptoTransform cTransform = tdes.CreateDecryptor();
            byte[] resultArray = cTransform.TransformFinalBlock(
                                 toEncryptArray, 0, toEncryptArray.Length);
            //Release resources held by TripleDes Encryptor                
            tdes.Clear();
            //return the Clear decrypted TEXT
            return UTF8Encoding.UTF8.GetString(resultArray);
        }


       }
}
</pre></p>
<p>Then we have to add this security key in our web.config in appSettings section. This can be any key that is referenced by our encrypt and decrypt function.</p>
<p><pre class="brush: xml;">
&lt;appSettings&gt;
    &lt;add key =&quot;SecurityKey&quot; value =&quot;1001101011000011&quot; /&gt;
  &lt;/appSettings&gt;
</pre></p>
<p>And here is how we use it in our page. We first add a reference to our SC.Utility namespace.</p>
<p><pre class="brush: csharp;">
using SC.Utilit;
</pre></p>
<p>Then on the page where we append our query string, we can do the below code.</p>
<p><pre class="brush: csharp;">
Response.Redirect(&quot;Products.aspx/&quot; + Security.Encrypt(&quot;category=books,sender=franco.robles,subcategoryid=horror,pricerange=100-1000&quot;, true));
</pre></p>
<p>And on our destination page, we can do the below code.<br />
<pre class="brush: csharp;">
Response.Write(Security.Decrypt(Request.PathInfo.Substring(1), true));
</pre> </p>
<p>Here is how it looks like on the browser after the request.<br />
<a href="http://francorobles.files.wordpress.com/2010/09/testurlrewrite.jpg"><img src="http://francorobles.files.wordpress.com/2010/09/testurlrewrite.jpg?w=640" alt="" title="testURLRewrite"   class="alignnone size-full wp-image-274" /></a></p>
<p>Not quite elegant solution but we did it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/271/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=271&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/09/06/url-rewrite-with-encryption-for-security-reasons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/09/testurlrewrite.jpg" medium="image">
			<media:title type="html">testURLRewrite</media:title>
		</media:content>
	</item>
		<item>
		<title>Saving Blob Files direct to SQL Server</title>
		<link>http://francorobles.wordpress.com/2010/09/05/saving-blob-files-direct-to-sql-server/</link>
		<comments>http://francorobles.wordpress.com/2010/09/05/saving-blob-files-direct-to-sql-server/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 10:27:34 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=253</guid>
		<description><![CDATA[The common thinking of a developer if asked for file upload and download component is to put it in a shared directory and upload it as part of a file system. But there is a more neater way of doing it and Sharepoint does it. Now, ill show you how I do it with ASP.NET. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=253&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The common thinking of a developer if asked for file upload and download component is to put it in a shared directory and upload it as part of a file system. But there is a more neater way of doing it and Sharepoint does it. Now, ill show you how I do it with ASP.NET.</p>
<p>First lets setup our page to support vb.net function call from client side using PageMethods.<br />
<pre class="brush: xml;">
.....
&lt;form id=&quot;frmStrive&quot; runat=&quot;server&quot;&gt;
&lt;asp:ScriptManager ID=&quot;scriptManager&quot; runat=&quot;server&quot; EnablePageMethods=&quot;true&quot; /&gt;
&lt;asp:FileUpload ID=&quot;fileUpload&quot; runat=&quot;server&quot; Width=&quot;100%&quot; onchange=&quot;PutDescOnParent(this.value);&quot;/&gt;
...
</pre><br />
right after our form tag is we created a scriptmanager and the most important thing is that we set EnablePageMethods=&#8221;true&#8221; which will do the trick.</p>
<p>Next we set up our client side code.<br />
<pre class="brush: xml;">
function onUploadClick(){
            if ($j(&quot;#txtUploadDesc&quot;).val() == '') {
                alert(&quot;Please put a description for this file.&quot;);
                return;
            }
    
            var vaild = fileUpload.value.length &gt; 0;
            if(vaild){
                //  disable the upload button
                $get('upload').disabled = 'disabled';
                
                //  update the message
                updateMessage('info', 'Initializing upload ...');
                PageMethods.SaveFileToDb(document.getElementById(&quot;txtUploadDesc&quot;).value);
                //  submit the form containing the fileupload
                
                form.submit();
....
</pre></p>
<p>Now if you&#8217;ll notice on the 14th line i called PageMethods.SaveFileToDb where it accepts one parameter and call a server side code. Lets see what it does from behind.</p>
<p><pre class="brush: xml;">
&lt;System.Web.Services.WebMethod()&gt; _
    &lt;System.Web.Script.Services.ScriptMethod()&gt; _
    Public Shared Sub SaveFileToDb()
        Dim files As New System.Collections.Generic.Dictionary(Of String, String)
        files = DirectCast(HttpContext.Current.Session(&quot;Files&quot;), System.Collections.Generic.Dictionary(Of String, String))

        For Each kvp As KeyValuePair(Of String, String) In files
            Using myConnection As New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings(&quot;DBConnection2&quot;).ConnectionString)
                Const SQL As String = &quot;INSERT INTO [tblFiles] (filename, filedescription, mainfile,parent) VALUES (@fileName, @fileDescription, @mainFile,@parent)&quot;
                Dim myCommand As New System.Data.SqlClient.SqlCommand(SQL, myConnection)
                myCommand.Parameters.AddWithValue(&quot;@fileName&quot;, kvp.Key)
                myCommand.Parameters.AddWithValue(&quot;@fileDescription&quot;, kvp.Value)
                Dim im As New _HR001
                Dim fle As New System.IO.FileInfo(im.GetPath(kvp.Key))
                im.Dispose()
                Dim imageBytes(fle.Length) As Byte
                Dim s As System.IO.Stream
                s = fle.OpenRead
                s.Read(imageBytes, 0, imageBytes.Length)
                myCommand.Parameters.Add(&quot;@mainFile&quot;, Data.SqlDbType.VarBinary)
                myCommand.Parameters(&quot;@mainFile&quot;).Value = imageBytes
                myCommand.Parameters.AddWithValue(&quot;@parent&quot;, New _HR001().GetGuid())
                myConnection.Open()
                myCommand.ExecuteNonQuery()
                myConnection.Close()
            End Using
        Next kvp
    End Sub
</pre></p>
<p>Now what this block of code does is that it simply retrieves the path of the file(s) the we temporarily store on a session then inserts those files to a particular table which in my case named tblFiles containing a varbinary(max) field which is the container of binary files. Oh by the way during the time we started our session, we created a temporary directory on the server which is identified via creating a unique id and is achieved by the below line.<br />
<pre class="brush: xml;">
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        Dim dir As New System.IO.DirectoryInfo(Server.MapPath(&quot;~/uploads/&quot;))
        dir.CreateSubdirectory(Session(&quot;TempDir&quot;))
        Session(&quot;Files&quot;) = New System.Collections.Generic.Dictionary(Of String, String)
End Sub 
</pre></p>
<p><b>NOTE:</b> In sql server 2000, you can upload up to 8mb files only, which is upgraded in sql server 2005 up. In sql server 2005 up? It depends on your disk space. Now let me show you the structure of my table.<br />
<a href="http://francorobles.files.wordpress.com/2010/09/fileimage1.jpg"><img src="http://francorobles.files.wordpress.com/2010/09/fileimage1.jpg?w=640" alt="" title="fileImage"   class="alignnone size-full wp-image-261" /></a></p>
<p>You might be asking, after saving to sql server how will i retrieve it? Here&#8217;s how.<br />
<pre class="brush: xml;">
Using myConnection As New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings(&quot;DBConnection2&quot;).ConnectionString)

                Const SQL As String = &quot;SELECT * from tblFiles where fileId=@fileId&quot;
                Dim myCommand As New System.Data.SqlClient.SqlCommand(SQL, myConnection)
                myCommand.Parameters.AddWithValue(&quot;@fileId&quot;, HttpContext.Current.Request.QueryString(&quot;fileId&quot;))

                myConnection.Open()
                Dim myReader As System.Data.SqlClient.SqlDataReader = myCommand.ExecuteReader

                If myReader.Read Then

                    Response.ClearContent()
                    Response.AddHeader(&quot;Content-Disposition&quot;, &quot;attachment; filename=&quot;&quot;&quot; &amp; myReader.Item(&quot;fileName&quot;) &amp; &quot;&quot;&quot;&quot;)

                    Dim bw As New System.IO.BinaryWriter(Response.OutputStream)
                    bw.Write(DirectCast(myReader(&quot;mainFile&quot;), Byte()))
                    bw.Close()

                    Response.End()

                End If

                myReader.Close()
                myConnection.Close()


            End Using
</pre></p>
<p>See the picture? Its not quite complex. Have to continue doing my project. My next blog will be about how to convert a lousy windows forms to WPF the silverlight way.</p>
<object height="81" width="100%"><param name="wmode" value="transparent"><param name="movie" value="http://player./player.swf?url=&amp;g=1&amp;"></param><embed height="81" src="http://player./player.swf?url=&amp;g=1&amp;" type="application/x-shockwave-flash" width="100%"> </embed> </object>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/253/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=253&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/09/05/saving-blob-files-direct-to-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/09/fileimage1.jpg" medium="image">
			<media:title type="html">fileImage</media:title>
		</media:content>
	</item>
		<item>
		<title>Cool jQuery Progress Indicator</title>
		<link>http://francorobles.wordpress.com/2010/08/27/cool-jquery-progress-indicator/</link>
		<comments>http://francorobles.wordpress.com/2010/08/27/cool-jquery-progress-indicator/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 17:31:49 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=237</guid>
		<description><![CDATA[One of my projects was to develop a automated employee automation application which will use jQuery. Today I am going to show you how you can create a cool progress indicator to tell your end user that something is going on behind the back of an action. Below is an image of the progress indicator [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=237&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of my projects was to develop a automated employee automation application which will use jQuery. Today I am going to show you how you can create a cool progress indicator to tell your end user that something is going on behind the back of an action. Below is an image of the progress indicator that slides from the top to the middle of the screen then displays the processing message then slides up and disappears once done.</p>
<p><strong>Processing Image</strong><br />
<a href="http://francorobles.files.wordpress.com/2010/08/image1.gif"><img src="http://francorobles.files.wordpress.com/2010/08/image1.gif?w=640" alt="" title="Image1"   class="alignnone size-full wp-image-238" /></a></p>
<p><strong>The Code</strong></p>
<p><pre class="brush: xml;">
&lt;html&gt;
&lt;head&gt;
	&lt;script src=&quot;scripts/jquery.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot; &gt;
		var $j = jQuery.noConflict();
		$j(document).ready(function(){
			$j(&quot;#btnSubmit&quot;).click(function(){
				$j(&quot;#messenger&quot;).css(&quot;width&quot;, document.body.offsetWidth);
        			$j(&quot;#messenger&quot;).css(&quot;height&quot;, document.body.offsetHeight);
        			$j(&quot;#messenger&quot;).css(&quot;opacity&quot;,.7);
        			$j(&quot;#messenger&quot;).fadeIn('fast');
				$j(&quot;#messengermessage&quot;).css(&quot;width&quot;, document.body.offsetWidth);
				$j(&quot;#messengermessage&quot;).animate({opacity: &quot;1&quot;, top: &quot;+=&quot; + addToAnimation, height: &quot;100&quot;, width: document.body.offsetWidth}, &quot;slow&quot;)
        			var myhtml = '&lt;div style=&quot;float:left; position:relative; padding-top:30px;&quot;&gt;&lt;img src=&quot;images/processing.gif&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;float:left; position:relative; padding-top:40px;&quot;&gt;&lt;font style=&quot;font-family:verdana; font-size:14px;color:#000000; font-weight:bold;&quot;&gt;saving attachments...&lt;/font&gt;&lt;/div&gt;'
        			$j(&quot;#messengermessage&quot;).html(&quot;&quot;);
        			$j(&quot;#messengermessage&quot;).html(myhtml);
				$j.post('handlers/EmployeeRequisition.ashx', {
					requestedBy : GetRequestedBy(),
                    			requestor : GetRequestor(),
                    			requisitionDate : $j(&quot;#dtpRequisitionDate&quot;).val()
				},
                		function(data) {
					myhtml = '&lt;div style=&quot;float:left; position:relative; padding-top:30px;&quot;&gt;&lt;img src=&quot;images/processing.gif&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;float:left; position:relative; padding-top:40px;&quot;&gt;&lt;font style=&quot;font-family:verdana; font-size:14px;color:#000000; font-weight:bold;&quot;&gt;form saved... &lt;/font&gt;&lt;/div&gt;'
                    			$j(&quot;#messengermessage&quot;).html(&quot;&quot;);
                    			$j(&quot;#messengermessage&quot;).html(myhtml);
                    			$j(&quot;#messengermessage&quot;).animate({opacity: &quot;1&quot;},2000, function(res) {
                        		var subtractThis = document.body.offsetHeight - 500;
                        		$j(&quot;#messengermessage&quot;).animate({opacity: &quot;0&quot;, top: &quot;-=&quot; + subtractThis, height: &quot;0&quot;, width: document.body.offsetWidth}, &quot;slow&quot;)
                        	        $j(&quot;#messenger&quot;).fadeOut('fast');
                    		});
			});
		});
	&lt;/script&gt;
&lt;/head&gt;
&lt;body style=&quot;font-family: Verdana; margin: 0px;&quot;&gt;
    &lt;form id=&quot;frmHR001&quot; runat=&quot;server&quot;&gt;
	&lt;div&gt;
		............

	&lt;/div&gt;
	&lt;div&gt;

		&lt;input type=&quot;button&quot; id=&quot;btnSubmit&quot; value=&quot;submit&quot; /&gt;
	&lt;/div&gt;
	&lt;div id=&quot;messenger&quot; style=&quot;float: none; position: absolute; width: 100%; height: 100%;
            background-color: #000000; display: none; left: 0; top: 0;&quot;&gt;
        &lt;/div&gt;
        &lt;div id=&quot;messengermessage&quot; style=&quot;float: none; position: absolute; width: 100%; height: 100px;
            background-color: #ffffff; display: none; left: 0; top: 0; text-align: center;&quot;&gt;
            &lt;div style=&quot;float: left; position: relative; padding-top: 30px;&quot;&gt;
                &lt;img src=&quot;images/processing.gif&quot; /&gt;
            &lt;/div&gt;
            &lt;div style=&quot;float: left; position: relative; padding-top: 40px;&quot;&gt;
                &lt;font style=&quot;font-family: Verdana; font-size: 14px; color: #000000; font-weight: bold;&quot;&gt;
                    processing...&lt;/font&gt;
            &lt;/div&gt;
        &lt;/div&gt; 
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p>The code is quite long but then again it achieves our purpose. Lets walk through the code and see how it happened.</p>
<p><strong>1. Our Html </strong><br />
The fading in gray background which is initially hidden through the display:none; css attribute.<br />
<pre class="brush: xml;">
&lt;div id=&quot;messenger&quot; style=&quot;float: none; position: absolute; width: 100%; height: 100%;
            background-color: #000000; display: none; left: 0; top: 0;&quot;&gt;
        &lt;/div&gt; 
</pre></p>
<p>The white progress indicator with the processing image.<br />
<pre class="brush: xml;">
&lt;div id=&quot;messengermessage&quot; style=&quot;float: none; position: absolute; width: 100%; height: 100px;
            background-color: #ffffff; display: none; left: 0; top: 0; text-align: center;&quot;&gt;
            &lt;div style=&quot;float: left; position: relative; padding-top: 30px;&quot;&gt;
                &lt;img src=&quot;images/processing.gif&quot; /&gt;
            &lt;/div&gt;
            &lt;div style=&quot;float: left; position: relative; padding-top: 40px;&quot;&gt;
                &lt;font style=&quot;font-family: Verdana; font-size: 14px; color: #000000; font-weight: bold;&quot;&gt;
                    saving form...&lt;/font&gt;
            &lt;/div&gt;
        &lt;/div&gt; 
</pre></p>
<p>The submit button which triggers the posting of data via our handler<br />
<pre class="brush: xml;">
&lt;input type=&quot;button&quot; id=&quot;btnSubmit&quot; value=&quot;submit&quot; /&gt;
</pre></p>
<p><strong>2. The jQuery code the does it all.</strong></p>
<p>First we reference our jquery library.<br />
<pre class="brush: xml;">
&lt;script src=&quot;scripts/jquery.js&quot;&gt;&lt;/script&gt;
</pre></p>
<p>Second we initiate our jQuery code;<br />
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot; &gt;
		var $j = jQuery.noConflict();
		$j(document).ready(function(){
                });
&lt;/script&gt;
</pre></p>
<p>Then we assign an click event to our submit button<br />
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot; &gt;
		var $j = jQuery.noConflict();
		$j(document).ready(function(){
			$j(&quot;#btnSubmit&quot;).click(function(){
                        });
		});
	&lt;/script&gt;
</pre></p>
<p>And inside our button the gray slightly transparent background occupies the whole width of the window<br />
<pre class="brush: xml;">
$j(&quot;#messenger&quot;).css(&quot;width&quot;, document.body.offsetWidth);
</pre></p>
<p>then occupies the whole height of the screen<br />
<pre class="brush: xml;">
$j(&quot;#messenger&quot;).css(&quot;height&quot;, document.body.offsetHeight);
</pre></p>
<p>we then set its opacity<br />
<pre class="brush: xml;">
$j(&quot;#messenger&quot;).css(&quot;opacity&quot;,.7);
</pre></p>
<p>and then here is the fading-in animation of the gray background<br />
<pre class="brush: xml;">
$j(&quot;#messenger&quot;).fadeIn('fast');
</pre></p>
<p>we then tell the white sliding progress indicator to occupy the whole width of the window<br />
<pre class="brush: xml;">
$j(&quot;#messengermessage&quot;).css(&quot;width&quot;, document.body.offsetWidth);
</pre></p>
<p>and finally the code that makes it slide saying that our form is currently doing something<br />
<pre class="brush: xml;">
$j(&quot;#messengermessage&quot;).animate({opacity: &quot;1&quot;, top: &quot;+=&quot; + addToAnimation, height: &quot;100&quot;, width: document.body.offsetWidth}, &quot;slow&quot;)
</pre></p>
<p>how does it slide up after the posting of data? just do the reverse of the latter.<br />
<pre class="brush: xml;">
$j(&quot;#messengermessage&quot;).animate({opacity: &quot;1&quot;},2000, function(res) {
var subtractThis = document.body.offsetHeight - 500;
$j(&quot;#messengermessage&quot;).animate({opacity: &quot;0&quot;, top: &quot;-=&quot; + subtractThis, height: &quot;0&quot;, width: document.body.offsetWidth}, &quot;slow&quot;)
</pre></p>
<p>and lastly we tell the gray background to fadeout since we are done with the processing<br />
<pre class="brush: xml;">
$j(&quot;#messenger&quot;).fadeOut('fast');
</pre></p>
<p>Thats it. Of course there are many cool progress indicators but this one is simple and easy to understand yet nice looking. By the way there is one great javascript library asside from jQuery that you would really love. Find out how, this is there site: www.sencha.com</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/237/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=237&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/08/27/cool-jquery-progress-indicator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/image1.gif" medium="image">
			<media:title type="html">Image1</media:title>
		</media:content>
	</item>
		<item>
		<title>The Project Tracker</title>
		<link>http://francorobles.wordpress.com/2010/08/26/the-project-tracker/</link>
		<comments>http://francorobles.wordpress.com/2010/08/26/the-project-tracker/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 14:33:09 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=192</guid>
		<description><![CDATA[It&#8217;s been a long time since I havent created a blog about silverlight. Ill make this short since I have lots of things to do, not just silverlight. Today, I am going to show my latest addition to my projects &#8220;The Project Tracker&#8221;. This will show that silverlight is not just for media. First ScreenThe [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=192&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since I havent created a blog about silverlight. Ill make this short since I have lots of things to do, not just silverlight. Today, I am going to show my latest addition to my projects &#8220;The Project Tracker&#8221;. This will show that silverlight is not just for media.</p>
<p><strong>First Screen</strong><br />The home screen. This window will list all the current user&#8217;s projects with Active Directory authentication.</br><a href="http://francorobles.files.wordpress.com/2010/08/1.gif"><img src="http://francorobles.files.wordpress.com/2010/08/1.gif?w=640" alt="" title="1"   class="alignnone size-full wp-image-216" /></a></p>
<p>
<strong>Second Screen</strong><br />The project creation screen. This window is where you save your current projects for tracking.<br /><a href="http://francorobles.files.wordpress.com/2010/08/2.gif"><img src="http://francorobles.files.wordpress.com/2010/08/2.gif?w=640" alt="" title="2"   class="alignnone size-full wp-image-218" /></a></p>
<p>
<strong>Third Screen</strong><br />The project attachment screen. This window is where you attach supporting documents for your project.<br /><a href="http://francorobles.files.wordpress.com/2010/08/3.gif"><img src="http://francorobles.files.wordpress.com/2010/08/3.gif?w=640" alt="" title="3"   class="alignnone size-full wp-image-220" /></a></p>
<p>
<strong>Fourth Screen</strong><br />The query screen. This window is where you will find the projects by you and your teammate and can be filtered via there status.<br /><a href="http://francorobles.files.wordpress.com/2010/08/41.gif"><img src="http://francorobles.files.wordpress.com/2010/08/41.gif?w=640" alt="" title="4"   class="alignnone size-full wp-image-225" /></a></p>
<p>
<strong>Fifth Screen</strong><br />The history window. This window is where you will keep track of who commented or did something to your posted project.<br /><a href="http://francorobles.files.wordpress.com/2010/08/51.gif"><img src="http://francorobles.files.wordpress.com/2010/08/51.gif?w=640" alt="" title="5"   class="alignnone size-full wp-image-228" /></a></br></br></br><br />
<strong>Sixth Screen</strong><br />The notification module. The highlighted object will slide up and stays for 5 seconds which acts like other notifications in the taskbar.<br /><a href="http://francorobles.files.wordpress.com/2010/08/62.gif"><img src="http://francorobles.files.wordpress.com/2010/08/62.gif?w=640" alt="" title="6"   class="alignnone size-full wp-image-234" /></a></p>
<p></p>
<p>Now who said that silverlight is just for animations and other things. Lets make it simple and straight. If you want a rich interactive web application for your audience use Silverlight. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=192&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/08/26/the-project-tracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/1.gif" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/2.gif" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/3.gif" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/41.gif" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/51.gif" medium="image">
			<media:title type="html">5</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/62.gif" medium="image">
			<media:title type="html">6</media:title>
		</media:content>
	</item>
		<item>
		<title>Dealing with dates in SQL Server for ASP.NET developers</title>
		<link>http://francorobles.wordpress.com/2010/08/25/dealing-with-dates-in-sql-server-for-asp-net-developers/</link>
		<comments>http://francorobles.wordpress.com/2010/08/25/dealing-with-dates-in-sql-server-for-asp-net-developers/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 14:23:42 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=194</guid>
		<description><![CDATA[This morning I was having a problem in saving date type of data to sql server. The problem? If the current language of your instance is us_english then the format of the date is mdy which is month/date/year. Now my requirement was to save and display as dmy or date/month/year. When you try to save [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=194&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This morning I was having a problem in saving date type of data to sql server. The problem? If the current language of your instance is us_english then the format of the date is mdy which is month/date/year. Now my requirement was to save and display as dmy or date/month/year. When you try to save the format it will throw an error saying that you are trying to store an invalid date. How to deal with this? Follow the below steps:</p>
<p>1. Identify the language that is currently used by your login. How? Execute the below script in sql server.</p>
<p><pre class="brush: sql;">
select name, language from master.dbo.syslogins
</pre></p>
<p>2.  If you can find your login there then identify the date format that is being used by your login&#8217;s language which you will know by issuing the below code in sql server.</p>
<p><pre class="brush: sql;">
select name ,alias, dateformat
from sys.syslanguages
</pre></p>
<p>which retrieve the below list.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/08/list.jpg"><img class="size-full wp-image-197 alignnone" title="list" src="http://francorobles.files.wordpress.com/2010/08/list.jpg?w=640" alt=""   /></a></p>
<p><a href="http://francorobles.files.wordpress.com/2010/08/list.jpg"></a><br />
3. Then identify your requirement, in my case i need to use the British English format which is dmy or date/month/year.  Now we have to change  our login&#8217;s language by issuing the below code in sql server</p>
<p><pre class="brush: sql;">
SET Language British
</pre></p>
<p>4.  We can now pass the dmy format to date fields in sql server by using the below code in asp.net.<br />
<pre class="brush: csharp;">
string.Format(&quot;{0:dd/MM/yyyy}&quot;, DateTime.Now);
</pre><br />
I hope this post will help those who will encounter problems with date formatting.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=194&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/08/25/dealing-with-dates-in-sql-server-for-asp-net-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/08/list.jpg" medium="image">
			<media:title type="html">list</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight on Facebook</title>
		<link>http://francorobles.wordpress.com/2010/02/10/silverlight-on-facebook/</link>
		<comments>http://francorobles.wordpress.com/2010/02/10/silverlight-on-facebook/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 16:54:10 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=184</guid>
		<description><![CDATA[For those who want to load their Silverlight application on Facebook. These are the steps.  This is the simplest implementation that i&#8217;ve tested so far. If you have a much better implementation, then lets share for the community. Facebook Setup 1. Login to Facebook. 2. Under Account menu, click Application Settings. 3. On the Developer [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=184&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For those who want to load their Silverlight application on Facebook. These are the steps.  This is the simplest implementation that i&#8217;ve tested so far. If you have a much better implementation, then lets share for the community.</p>
<address> </address>
<address><strong>Facebook Setup</strong></address>
<p>1. Login to Facebook.</p>
<p>2. Under Account menu, click <strong>Application Settings</strong>.</p>
<p>3. On the Developer row, <strong>click Profile</strong>.</p>
<p>4. On the Developer Profile, click <strong>Go To Application</strong>.</p>
<p>5. On the Profile Page, click <strong>Setup A New Application</strong>.</p>
<p>6. On the Create Application Page, type a name for your application and press <strong>Create Application</strong>.</p>
<p>7. On the Application Page, Select <strong>Canvas</strong> on the left menu.</p>
<p>8. Once in the Canvas Page, go to the Reguired URLs section. And provide the below parameters.</p>
<p>Canvas Page URL = &#8220;Name of your application&#8221;<br />
Canvas Callback URL = &#8220;Url of the application except for the page that is hosting your silverlight app.&#8221;<br />
Example: <a title="http://114.129.36.226/Numberplate/NumberPlateFreeTestPage.aspx" rel="nofollow" href="http://114.129.36.226/Numberplate/NumberPlateFreeTestPage.aspx">http://YourDomain.com/SLHost.aspx</a><br />
must be <a title="http://114.129.36.226/Numberplate/" rel="nofollow" href="http://114.129.36.226/Numberplate/">http://</a><a title="http://114.129.36.226/Numberplate/NumberPlateFreeTestPage.aspx" rel="nofollow" href="http://114.129.36.226/Numberplate/NumberPlateFreeTestPage.aspx">YourDomain.com</a><a title="http://114.129.36.226/Numberplate/" rel="nofollow" href="http://114.129.36.226/Numberplate/">/</a></p>
<p>9. Save your Application.</p>
<p><em><strong>IIS Settings</strong></em></p>
<p>1. Under <strong>Default Web Site</strong>, navigate to your Application and select <strong>Features View</strong></p>
<p>2. On the features view, double-click <strong>Default Document</strong>.</p>
<p>3. On the Default Documents, add the Web page the hosts the silverlight control.</p>
<p><a id="To_View_Your_Application" name="To_View_Your_Application"></a></p>
<p><em><strong>To View Your Application</strong></em></p>
<p>1. After saving your newly created application, click <strong>View Application Profile</strong>.</p>
<p>2. In the Application Profile Page, click <strong>Go To Application</strong>.</p>
<p>This is my sample<strong> </strong>silverlight application on facebook.</p>
<p>http://apps.facebook.com/grabsystem/?_fb_fromhash=c2fadd6db696955004c7711200213355</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=184&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/02/10/silverlight-on-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing WCF Services with WCFTestClient</title>
		<link>http://francorobles.wordpress.com/2010/01/22/testing-wcf-services-with-wcftestclient/</link>
		<comments>http://francorobles.wordpress.com/2010/01/22/testing-wcf-services-with-wcftestclient/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 18:32:49 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=171</guid>
		<description><![CDATA[This is for those who dont know this Add-in tool yet which is very usefull when it comes to developing WCF services. I&#8217;ve been searching for this Add-In since, luckily I had a Team Lead which is not that selfish in terms of knowledge sharing. So I will do the same for those who has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=171&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is for those who dont know this Add-in tool yet which is very usefull when it comes to developing WCF services. I&#8217;ve been searching for this Add-In since, luckily I had a Team Lead which is not that selfish in terms of knowledge sharing. So I will do the same for those who has problems debugging their wcf service.</p>
<p>Okey here are the steps.</p>
<p>1.) Locate the add-in which resides on your installation path under \Microsoft Visual Studio 9.0\Common\IDE\WcfTestClient.exe</p>
<p>IE: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.exe</p>
<p>2.) Add WCF TestClient to your External tools under Tools &gt; External Tools menu of VS 2008. Under the Command field, copy and paste that path of the WCFTestClient.exe. And you name the tool in the Title field like the image you see below.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/addtoexternaltools.jpg"><img src="http://francorobles.files.wordpress.com/2010/01/addtoexternaltools.jpg?w=640" alt="" title="AddToExternalTools"   class="alignleft size-full wp-image-173" /></a></p>
<p><strong>Debugging Example</strong></p>
<p>1.) Build your project containing the wcf service.<br />
2.) Launch the WCTTestClient which will appear under the Tools menu of Visual Studio 2008 after adding in the external tools.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/initialwindow.jpg"><img src="http://francorobles.files.wordpress.com/2010/01/initialwindow.jpg?w=640" alt="" title="InitialWindow"   class="alignleft size-full wp-image-175" /></a></p>
<p>3.) Right-click &#8220;My Service Projects&#8221; and select &#8220;Add Service&#8221;</p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/addtheserice.jpg"><img src="http://francorobles.files.wordpress.com/2010/01/addtheserice.jpg?w=640" alt="" title="AddTheSerice"   class="alignleft size-full wp-image-177" /></a></p>
<p>4.) Once the service is successfully added. Your service operations will be listed in the left pane. To test these service operations, just double &#8211; click the operation and press invoke.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/finalwindow.jpg"><img src="http://francorobles.files.wordpress.com/2010/01/finalwindow.jpg?w=640" alt="" title="FinalWindow"   class="alignleft size-full wp-image-179" /></a></p>
<p>Any breakpoint(s) in the service method which is invoked will cause a break point after pressing invoke.</p>
<p>Finally, our problem of testing a wcf service has been made easy with Visual Studio 2008&#8242;s WCF Test Client.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/171/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=171&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/01/22/testing-wcf-services-with-wcftestclient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/addtoexternaltools.jpg" medium="image">
			<media:title type="html">AddToExternalTools</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/initialwindow.jpg" medium="image">
			<media:title type="html">InitialWindow</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/addtheserice.jpg" medium="image">
			<media:title type="html">AddTheSerice</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/finalwindow.jpg" medium="image">
			<media:title type="html">FinalWindow</media:title>
		</media:content>
	</item>
		<item>
		<title>Embedding a Font at runtime in Silverlight</title>
		<link>http://francorobles.wordpress.com/2010/01/19/embedding-a-font-at-runtime-in-silverlight/</link>
		<comments>http://francorobles.wordpress.com/2010/01/19/embedding-a-font-at-runtime-in-silverlight/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 18:18:59 +0000</pubDate>
		<dc:creator>francorobles</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://francorobles.wordpress.com/?p=141</guid>
		<description><![CDATA[Most of us wants our RI Application to be flexible as much as possible, and at the same time compatible and is uniform to the resources that we are using. A common example for this scenario is when using a font family that is not commonly installed in the client&#8217;s computer. Now you can picture the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=141&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Most of us wants our RI Application to be flexible as much as possible, and at the same time compatible and is uniform to the resources that we are using. A common example for this scenario is when using a font family that is not commonly installed in the client&#8217;s computer. Now you can picture the problem. Lets say, i have a rounded font, which is widely used in all of my xaml pages and it is not pressent in the users machine. Solution? Embed the font to our application. In this article I&#8217;ll show you how to achieve that with these few lines of code.</p>
<p><strong>Add your font file as embedded resource to your Siverlight Project.</strong></p>
<p><strong>1. Add font to project.</strong></p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/embedfont1.jpg"><img class="alignleft size-full wp-image-142" title="EmbedFont1" src="http://francorobles.files.wordpress.com/2010/01/embedfont1.jpg?w=640" alt=""   /></a></p>
<p><strong>2. Set Build Action of your font file as Embedded Resource </strong></p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/embedfont2.jpg"><img class="alignleft size-full wp-image-144" title="EmbedFont2" src="http://francorobles.files.wordpress.com/2010/01/embedfont2.jpg?w=640" alt=""   /></a></p>
<p>After adding the font as embedded resource, we can now call the font in a form of a Stream. But before that, lets see the content of our xaml page.</p>
<p><pre class="brush: xml;">

&lt;UserControl x:Class=&quot;EmbedFont.MainPage&quot;
  xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
  xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml&quot;
  xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
  xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
    mc:Ignorable=&quot;d&quot; d:DesignWidth=&quot;640&quot; d:DesignHeight=&quot;480&quot;&gt;
  &lt;Grid x:Name=&quot;LayoutRoot&quot;&gt;
        &lt;TextBlock x:Name=&quot;txtRoundedFont&quot; FontSize=&quot;30&quot; Text=&quot;Dont stop learning.&quot;/&gt;
  &lt;/Grid&gt;
&lt;/UserControl&gt;

</pre></p>
<p>On our Xaml page we have a TextBlock named txtRoundedFont and by running the application the result will be something like this silverlight page with its default font family</p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/embedfont3.jpg"><img class="alignleft size-full wp-image-147" title="EmbedFont3" src="http://francorobles.files.wordpress.com/2010/01/embedfont3.jpg?w=640" alt=""   /></a></p>
<p>Finally, in order for this to work, we need to add a loaded event on our xaml pages&#8217; constructor.</p>
<p><pre class="brush: csharp;">
this.Loaded += new RoutedEventHandler(MainPage_Loaded);
</pre></p>
<p>And inside our loaded event will be this three lines of code.</p>
<p><pre class="brush: csharp;">void MainPage_Loaded(object sender, RoutedEventArgs e) {
	System.IO.Stream streamedFont = this.GetType().Assembly.GetManifestResourceStream(&quot;EmbedFont.Fonts.VAGRounded-Black_0.otf&quot;);
	txtRoundedFont.FontSource = new FontSource(streamedFont);
	txtRoundedFont.FontFamily = new FontFamily(&quot;VAGRounded&quot;);
}
</pre></p>
<p>And here is our new TextBlock with an embedded font.</p>
<p><a href="http://francorobles.files.wordpress.com/2010/01/embedfont4.jpg"><img class="alignleft size-full wp-image-154" title="EmbedFont4" src="http://francorobles.files.wordpress.com/2010/01/embedfont4.jpg?w=640" alt=""   /></a></p>
<p><strong>Now how did we achieve that?</strong><br />
First we have the below statement which loads our embedded font resource and assign that to our streamedFont identifier which is of type System.IO.Stream. Now inside our GetManifestResourceStream function is a string parameter which represents our project name &#8220;Embed.&#8221; then the folder inside our project &#8220;Embed.Fonts.&#8221; then the file name &#8220;Embed.Fonts.VAGRounded-Black.otf&#8221;.</p>
<p><pre class="brush: csharp;">
System.IO.Stream streamedFont = this.GetType().Assembly.GetManifestResourceStream(&quot;EmbedFont.Fonts.VAGRounded-Black_0.otf&quot;);
</pre></p>
<p>The second line simply assigns our streamedFont bufferred data to the FontSource property of txtRoundedFont textblock.<br />
<pre class="brush: csharp;"> 
 txtRoundedFont.FontSource = new FontSource(streamedFont);
</pre></p>
<p>Finally, we have to insert our final statment which sets the font family of our textblock.<br />
<pre class="brush: csharp;">
txtRoundedFont.FontFamily = new FontFamily(&quot;VAGRounded&quot;);
</pre></p>
<p>NOTE: To know the exact name of a font. Double-click the file and check the font name.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francorobles.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/francorobles.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/francorobles.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/francorobles.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/francorobles.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/francorobles.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/francorobles.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/francorobles.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/francorobles.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/francorobles.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/francorobles.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/francorobles.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/francorobles.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/francorobles.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=francorobles.wordpress.com&amp;blog=9565298&amp;post=141&amp;subd=francorobles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://francorobles.wordpress.com/2010/01/19/embedding-a-font-at-runtime-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e5401e5454923ee5391950fc1eddf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">francorobles</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/embedfont1.jpg" medium="image">
			<media:title type="html">EmbedFont1</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/embedfont2.jpg" medium="image">
			<media:title type="html">EmbedFont2</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/embedfont3.jpg" medium="image">
			<media:title type="html">EmbedFont3</media:title>
		</media:content>

		<media:content url="http://francorobles.files.wordpress.com/2010/01/embedfont4.jpg" medium="image">
			<media:title type="html">EmbedFont4</media:title>
		</media:content>
	</item>
	</channel>
</rss>
