<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>C#</title>
        <link>http://geekswithblogs.net/sglima/category/10034.aspx</link>
        <description>C#</description>
        <language>pt</language>
        <copyright>Sglima</copyright>
        <managingEditor>sglima@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>string.Format input string was not in a correct format</title>
            <link>http://geekswithblogs.net/sglima/archive/2011/12/19/string.format-input-string-was-not-in-a-correct-format.aspx</link>
            <description>
		&lt;span style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;If you have a "{" or "}" inside a string when using string.format you will get the error mentioned in the title.&lt;/span&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;
				&lt;br /&gt;
		&lt;/div&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;To fix this you must double the charater.&lt;/div&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;
				&lt;br /&gt;
		&lt;/div&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;Error Example: &lt;/div&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;string teste = string.Format(" This is a {teste} {0} ", mystring);&lt;/div&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;
				&lt;br /&gt;
		&lt;/div&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;Correct Example:&lt;/div&gt;
		&lt;div style="font:/normal &amp;quot;Times New Roman&amp;quot;; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"&gt;string teste = string.Format(" This is a {{teste}} {0} ", mystring);v&lt;/div&gt;
 &lt;img src="http://geekswithblogs.net/sglima/aggbug/148084.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2011/12/19/string.format-input-string-was-not-in-a-correct-format.aspx</guid>
            <pubDate>Mon, 19 Dec 2011 15:46:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/148084.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2011/12/19/string.format-input-string-was-not-in-a-correct-format.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/148084.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to execute a javascript function every time an updatepanel executes an async postback</title>
            <link>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-execute-a-javascript-function-every-time-an-updatepanel.aspx</link>
            <description>&lt;p&gt;&amp;lt;script type="text/javascript" language="javascript"&amp;gt;&lt;/p&gt;
&lt;p&gt;        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(refresh);&lt;/p&gt;
&lt;p&gt;        function refresh()          {  		//Your code here;  	}&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a targuet="_blank" href="http://zeemalik.wordpress.com/2007/11/27/how-to-call-client-side-javascript-function-after-an-updatepanel-asychronous-ajax-request-is-over/"&gt;Source&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/146956.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-execute-a-javascript-function-every-time-an-updatepanel.aspx</guid>
            <pubDate>Tue, 20 Sep 2011 09:57:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/146956.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-execute-a-javascript-function-every-time-an-updatepanel.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/146956.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Upload a file using FTP</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-upload-a-file-using-ftp.aspx</link>
            <description>&lt;p&gt; FileInfo fileInf = new FileInfo("c:\myfile.txt");&lt;/p&gt;
&lt;p&gt;FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://myFTPSite/myfile.txt"));&lt;/p&gt;
&lt;p&gt;reqFTP.Credentials = new NetworkCredential("myUser","myPassword", "myFTPDomain");&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;reqFTP.KeepAlive = false;&lt;br /&gt;
reqFTP.Method = WebRequestMethods.Ftp.UploadFile;&lt;br /&gt;
reqFTP.UseBinary = true;&lt;/p&gt;
&lt;p&gt;reqFTP.ContentLength = fileInf.Length;&lt;/p&gt;
&lt;p&gt;int buffLength = 2048;&lt;br /&gt;
byte[] buff = new byte[buffLength];&lt;br /&gt;
int contentLen;&lt;/p&gt;
&lt;p&gt;FileStream fs = fileInf.OpenRead();&lt;/p&gt;
&lt;p&gt;try&lt;br /&gt;
{&lt;br /&gt;
    Stream strm = reqFTP.GetRequestStream();&lt;br /&gt;
    contentLen = fs.Read(buff, 0, buffLength);&lt;br /&gt;
    while (contentLen != 0)&lt;br /&gt;
    {&lt;br /&gt;
        strm.Write(buff, 0, contentLen);&lt;br /&gt;
        contentLen = fs.Read(buff, 0, buffLength);&lt;br /&gt;
    }&lt;br /&gt;
    strm.Close();&lt;br /&gt;
    fs.Close();&lt;br /&gt;
}&lt;br /&gt;
catch (Exception ex)&lt;br /&gt;
{&lt;br /&gt;
    Console.WriteLine(ex.Message);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Enjoy :)&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/142185.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-upload-a-file-using-ftp.aspx</guid>
            <pubDate>Thu, 07 Oct 2010 16:31:42 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/142185.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-upload-a-file-using-ftp.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/142185.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Download a file using FTP</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-download-a-file-using-ftp.aspx</link>
            <description>&lt;p&gt;FileStream outputStream = new FileStream("c:\myfilefolder\file.txt");&lt;br /&gt;
FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://myFTPSite/file.txt"));&lt;/p&gt;
&lt;p&gt;reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;&lt;br /&gt;
reqFTP.UseBinary = true;&lt;br /&gt;
reqFTP.Credentials = new NetworkCredential("myUser","MyPassword","FTPDomain");&lt;/p&gt;
&lt;p&gt;FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();&lt;br /&gt;
Stream ftpStream = response.GetResponseStream();&lt;/p&gt;
&lt;p&gt;int bufferSize = 2048;&lt;br /&gt;
int readCount;&lt;br /&gt;
byte[] buffer = new byte[bufferSize];&lt;/p&gt;
&lt;p&gt;readCount = ftpStream.Read(buffer, 0, bufferSize);&lt;br /&gt;
while (readCount &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
    outputStream.Write(buffer, 0, readCount);&lt;br /&gt;
    readCount = ftpStream.Read(buffer, 0, bufferSize);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;ftpStream.Close();&lt;br /&gt;
outputStream.Close();&lt;br /&gt;
response.Close();&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Enjoy :)&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/142183.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-download-a-file-using-ftp.aspx</guid>
            <pubDate>Thu, 07 Oct 2010 16:24:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/142183.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-download-a-file-using-ftp.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/142183.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: List Files from an FTP Location</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-list-files-from-an-ftp-location.aspx</link>
            <description>&lt;p&gt;FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://myFTPURL/"));&lt;br /&gt;
reqFTP.UseBinary = true;&lt;br /&gt;
reqFTP.Credentials = new NetworkCredential("myUser", "myPassword", "FTPDomain");&lt;/p&gt;
&lt;p&gt;reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;&lt;/p&gt;
&lt;p&gt;WebResponse response = reqFTP.GetResponse();&lt;br /&gt;
StreamReader reader = new StreamReader(response.GetResponseStream());&lt;/p&gt;
&lt;p&gt;string line = reader.ReadLine();&lt;br /&gt;
while (line != null)&lt;br /&gt;
{&lt;br /&gt;
    line = reader.ReadLine();&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;reader.Close();&lt;br /&gt;
response.Close();&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Enjoy :)&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/142182.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-list-files-from-an-ftp-location.aspx</guid>
            <pubDate>Thu, 07 Oct 2010 16:17:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/142182.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/10/07/how-to-list-files-from-an-ftp-location.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/142182.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Export A Class to XML</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/08/17/how-to-export-a-class-to-xml.aspx</link>
            <description>&lt;p&gt;&lt;b&gt;The scenario: &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Imagine someone asks you to create an XML file with some data structure.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The approuch:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;There are several ways to achieve this, the fastest and less time comsuming is to create a class structure that represents the XML structure you need, fill in with the data and them serialize it to a string and save it to a file.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The Implementation: &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Lets say you need a single node, followed by an array of nodes.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Class Definition:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;public class MyNode&lt;br /&gt;
{&lt;/p&gt;
&lt;div style="padding-left: 20px"&gt;[XmlElementAttribute("code")]&lt;br /&gt;
public int code;&lt;br /&gt;
[XmlElementAttribute("description")]&lt;br /&gt;
public string description;&lt;/div&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;public class Item&lt;br /&gt;
{&lt;/p&gt;
&lt;div style="padding-left: 20px"&gt;[XmlAttribute("name")]&lt;br /&gt;
public string name;&lt;br /&gt;
[XmlAttribute("value")]&lt;br /&gt;
public string value;&lt;/div&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;[XmlRootAttribute("myClass", IsNullable = false, Namespace = "")]&lt;br /&gt;
public class MyClass&lt;br /&gt;
{&lt;/p&gt;
&lt;div style="padding-left: 20px"&gt;public MyClass()&lt;br /&gt;
{
&lt;div style="padding-left: 20px"&gt;myNode = new MyNode();&lt;/div&gt;
}
&lt;p&gt; &lt;/p&gt;
[XmlElementAttribute("myNode")]&lt;br /&gt;
public MyNode myNode;
&lt;p&gt; &lt;/p&gt;
[XmlArrayAttribute("myArray")]&lt;br /&gt;
public List&amp;lt;Item&amp;gt; myArray = new List&amp;lt;Item&amp;gt;();
&lt;p&gt; &lt;/p&gt;
public override string ToString()&lt;br /&gt;
{
&lt;div style="padding-left: 20px"&gt;try&lt;br /&gt;
{
&lt;div style="padding-left: 20px"&gt;string xmlString = null;&lt;br /&gt;
MemoryStream memoryStream = new MemoryStream();&lt;br /&gt;
XmlSerializer xs = new XmlSerializer(typeof(MyClass));&lt;br /&gt;
XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);&lt;br /&gt;
xs.Serialize(xmlTextWriter, this);&lt;br /&gt;
memoryStream = (MemoryStream)xmlTextWriter.BaseStream;&lt;br /&gt;
xmlString = UTF8ByteArrayToString(memoryStream.ToArray());&lt;br /&gt;
return xmlString;&lt;/div&gt;
}&lt;br /&gt;
catch&lt;br /&gt;
{
&lt;div style="padding-left: 20px"&gt;return string.Empty;&lt;/div&gt;
}&lt;/div&gt;
}
&lt;p&gt; &lt;/p&gt;
private static string UTF8ByteArrayToString(byte[] characters)&lt;br /&gt;
{
&lt;div style="padding-left: 20px"&gt;UTF8Encoding encoding = new UTF8Encoding();&lt;br /&gt;
string constructedString = encoding.GetString(characters);&lt;br /&gt;
return (constructedString);&lt;/div&gt;
}
&lt;p&gt; &lt;/p&gt;
private static Byte[] StringToUTF8ByteArray(string pXmlString)&lt;br /&gt;
{
&lt;div style="padding-left: 20px"&gt;UTF8Encoding encoding = new UTF8Encoding();&lt;br /&gt;
byte[] byteArray = encoding.GetBytes(pXmlString);&lt;br /&gt;
return byteArray;&lt;/div&gt;
}
&lt;p&gt; &lt;/p&gt;
public static MyClass DeserializeObject(string xml)&lt;br /&gt;
{
&lt;div style="padding-left: 20px"&gt;XmlSerializer xs = new XmlSerializer(typeof(MyClass));&lt;br /&gt;
MemoryStream memoryStream = new MemoryStream(StringToUTF8ByteArray(xml));&lt;br /&gt;
XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);&lt;br /&gt;
return (MyClass)xs.Deserialize(memoryStream);&lt;/div&gt;
}&lt;br /&gt;
 &lt;/div&gt;
&lt;p&gt;}&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Now, to use these classes:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;public static string myFunction()&lt;br /&gt;
{&lt;/p&gt;
&lt;div style="padding-left: 20px"&gt;MyClass fido = new MyClass();&lt;br /&gt;
fido.myNode.code = 1;&lt;br /&gt;
fido.myNode.description="sample text";&lt;br /&gt;
myArray.Add(new Item{name="name1", value="value1"});&lt;br /&gt;
myArray.Add(new Item{name="name2", value="value2"});&lt;br /&gt;
return fido.ToString();&lt;/div&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Executing this you will get an string as such:&lt;/p&gt;
&lt;p&gt;﻿&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;
&amp;lt;myClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&amp;gt;&lt;/p&gt;
&lt;div style="padding-left: 20px"&gt;&amp;lt;myNode&amp;gt;
&lt;div style="padding-left: 20px"&gt;&amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;sample text&amp;lt;/description&amp;gt;&lt;/div&gt;
&amp;lt;/myNode&amp;gt;&lt;br /&gt;
&amp;lt;myArray&amp;gt;
&lt;div style="padding-left: 20px"&gt;&amp;lt;Item name="name1" value="value1" /&amp;gt;&lt;br /&gt;
&amp;lt;Item name="name2" value="value2" /&amp;gt;&lt;/div&gt;
&amp;lt;/myArray&amp;gt;&lt;/div&gt;
&lt;p&gt;&amp;lt;/myClass&amp;gt;&lt;/p&gt;
&lt;p&gt;Using the string returned from "fido.ToString()" in the method DeserializeObject will get you the original values for the object.&lt;/p&gt;
&lt;p&gt;Hope this can be helpfull,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Enjoy :)&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/141352.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/08/17/how-to-export-a-class-to-xml.aspx</guid>
            <pubDate>Tue, 17 Aug 2010 15:54:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/141352.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/08/17/how-to-export-a-class-to-xml.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/141352.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Linq error: MSDTC on server 'servername' is unavailable</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/08/11/linq-error-msdtc-on-server-servername-is-unavailable.aspx</link>
            <description>&lt;p&gt;Occasionally an application that I am working on throws the above error... &lt;/p&gt;
&lt;p&gt;After trying to fix my code for a bit, and not finding the problem I googled a bit and discovered that this error is caused by a windows service that must be running.&lt;/p&gt;
&lt;p&gt;So, if you ever encounter this error, you must turn on the 'Distributed Transaction Coordinator' in order to solve it.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Original source: &lt;a href="http://geekswithblogs.net/narent/archive/2006/10/09/93544.aspx"&gt;http://geekswithblogs.net/narent/archive/2006/10/09/93544.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/141277.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/08/11/linq-error-msdtc-on-server-servername-is-unavailable.aspx</guid>
            <pubDate>Wed, 11 Aug 2010 11:39:50 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/141277.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/08/11/linq-error-msdtc-on-server-servername-is-unavailable.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/141277.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Invoke a method by name</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/05/31/how-to-invoke-a-method-by-name.aspx</link>
            <description>&lt;p&gt;Type myType = typeof(MyClass);&lt;/p&gt;
&lt;p&gt;string methodName = "methodNameAsString";&lt;/p&gt;
&lt;p&gt;MethodInfo myTypeGetMethod = myType.GetMethod(methodName);&lt;/p&gt;
&lt;p&gt;MyClass obj = new MyClass();&lt;/p&gt;
&lt;p&gt;object[] parms = { 123, "string test"};&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: #ff9900"&gt;myTypeGetMethod.Invoke(obj, args);&lt;/span&gt;&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/140158.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/05/31/how-to-invoke-a-method-by-name.aspx</guid>
            <pubDate>Mon, 31 May 2010 13:41:50 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/140158.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/05/31/how-to-invoke-a-method-by-name.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/140158.aspx</wfw:commentRss>
        </item>
        <item>
            <title>WTF #4</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/03/23/wtf-4.aspx</link>
            <description>&lt;p&gt;Well... I cant really express my feelings for this kind of programming...&lt;/p&gt;
&lt;p&gt;The WTF way:&lt;/p&gt;
&lt;p&gt;DateTime myNewDate = DateTime.Parse((myOldDate.Year - 1).ToString() + "-" + myOldDate.Month.ToString() + "-" + myOldDate.Day.ToString());&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The right way:&lt;/p&gt;
&lt;p&gt; DateTime myNewDate = myOldDate.Date.AddYears(-1);&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/138753.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/03/23/wtf-4.aspx</guid>
            <pubDate>Tue, 23 Mar 2010 17:17:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/138753.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/03/23/wtf-4.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/138753.aspx</wfw:commentRss>
        </item>
        <item>
            <title>WTF #3</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/03/15/wtf-3.aspx</link>
            <description>&lt;p&gt;Well, this one i simply cannot understand... why anyone would do +0 after and int.parse. Any Ideas?&lt;/p&gt;
&lt;p&gt;int myVar = Int32.Parse(ConfigurationManager.AppSettings["mySetting"] + "") + 0;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/138525.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/03/15/wtf-3.aspx</guid>
            <pubDate>Mon, 15 Mar 2010 12:52:36 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/138525.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/03/15/wtf-3.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/138525.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
