<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vision</title>
	<atom:link href="http://www.systemicsonline.com/vision/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.systemicsonline.com/vision</link>
	<description>Let's Get Technical</description>
	<lastBuildDate>Wed, 27 Jan 2010 08:15:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>c# Console Progress Bar</title>
		<link>http://www.systemicsonline.com/vision/?p=144</link>
		<comments>http://www.systemicsonline.com/vision/?p=144#comments</comments>
		<pubDate>Wed, 27 Jan 2010 08:15:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=144</guid>
		<description><![CDATA[    private static void drawTextProgressBar(decimal progress, decimal total)     {       //draw empty progress bar       Console.CursorLeft = 0;       Console.Write(&#8220;["); //start       Console.CursorLeft = 32;       Console.Write("]&#8220;); //end       Console.CursorLeft = 1;       float onechunk = 30.0f / (int)total;       //draw filled part       int position = 1;       for (int i = 0; [...]]]></description>
			<content:encoded><![CDATA[<p>    private static void drawTextProgressBar(decimal progress, decimal total)<br />
    {<br />
      //draw empty progress bar<br />
      Console.CursorLeft = 0;<br />
      Console.Write(&#8220;["); //start<br />
      Console.CursorLeft = 32;<br />
      Console.Write("]&#8220;); //end<br />
      Console.CursorLeft = 1;<br />
      float onechunk = 30.0f / (int)total;</p>
<p>      //draw filled part<br />
      int position = 1;<br />
      for (int i = 0; i &lt; onechunk * (int)progress; i++)<br />
      {<br />
        Console.BackgroundColor = ConsoleColor.Green;<br />
        Console.CursorLeft = position++;<br />
        Console.Write(&#8221; &#8220;);<br />
      }</p>
<p>      //draw unfilled part<br />
      for (int i = position; i &lt;= 31; i++)<br />
      {<br />
        Console.BackgroundColor = ConsoleColor.Black;<br />
        Console.CursorLeft = position++;<br />
        Console.Write(&#8221; &#8220;);<br />
      }</p>
<p>      //draw totals<br />
      Console.CursorLeft = 34;<br />
      Console.BackgroundColor = ConsoleColor.Black;<br />
      decimal value = Math.Round  ((progress / total) * 100,0);<br />
      Console.Write(value.ToString () + &#8220;%    &#8220;); //blanks at the end remove any excess<br />
    }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=144</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c# Create XML Classes from XML Data</title>
		<link>http://www.systemicsonline.com/vision/?p=141</link>
		<comments>http://www.systemicsonline.com/vision/?p=141#comments</comments>
		<pubDate>Mon, 14 Dec 2009 12:54:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=141</guid>
		<description><![CDATA[Use the following exe. copy &#8220;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\xsd.exe&#8221; &#8220;C:\Windows\System32&#8243; xsd file.xml xsd file.xsd /classes]]></description>
			<content:encoded><![CDATA[<p>Use the following exe.</p>
<p>copy &#8220;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\xsd.exe&#8221; &#8220;C:\Windows\System32&#8243;</p>
<p>xsd file.xml</p>
<p>xsd file.xsd /classes</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=141</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Culture</title>
		<link>http://www.systemicsonline.com/vision/?p=138</link>
		<comments>http://www.systemicsonline.com/vision/?p=138#comments</comments>
		<pubDate>Thu, 03 Dec 2009 07:32:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=138</guid>
		<description><![CDATA[if (CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern != &#8220;yyyy/mm/dd&#8221;)       {         //Registry Logic         //Open Sub key         RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@&#8221;Control Panel\International&#8221;, true);         ///Set Values         rkey.SetValue(&#8220;sShortDate&#8221;, Constants.ShortDatePattern);         //Close the Registry         rkey.Close();         MessageBox.Show(&#8220;System has been reconfigured.&#8221; + &#8220;\r\n\r\n&#8221; + &#8220;Please restart application.&#8221;, Constants.ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);         Application.Current.Shutdown();       }]]></description>
			<content:encoded><![CDATA[<p>if (CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern != &#8220;yyyy/mm/dd&#8221;)<br />
      {<br />
        //Registry Logic<br />
        //Open Sub key<br />
        RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@&#8221;Control Panel\International&#8221;, true);<br />
        ///Set Values<br />
        rkey.SetValue(&#8220;sShortDate&#8221;, Constants.ShortDatePattern);<br />
        //Close the Registry<br />
        rkey.Close();<br />
        MessageBox.Show(&#8220;System has been reconfigured.&#8221; + &#8220;\r\n\r\n&#8221; + &#8220;Please restart application.&#8221;, Constants.ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);<br />
        Application.Current.Shutdown();<br />
      }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=138</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GetDefault printer</title>
		<link>http://www.systemicsonline.com/vision/?p=135</link>
		<comments>http://www.systemicsonline.com/vision/?p=135#comments</comments>
		<pubDate>Wed, 11 Nov 2009 05:59:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=135</guid>
		<description><![CDATA[   using System.Management; public static string GetDefaultPrinter()     {       string strQuery = &#8220;SELECT * FROM Win32_Printer&#8221;;       ObjectQuery objectQuery = new ObjectQuery(strQuery);       ManagementObjectSearcher query = new ManagementObjectSearcher(objectQuery);       ManagementObjectCollection queryCollection = query.Get();       foreach (ManagementObject managementObject in queryCollection)       {         PropertyDataCollection propertyDataCollection = managementObject.Properties;         if ((bool)managementObject["Default"]) // DEFAULT PRINTER         { [...]]]></description>
			<content:encoded><![CDATA[<p>   using System.Management;</p>
<p>public static string GetDefaultPrinter()<br />
    {<br />
      string strQuery = &#8220;SELECT * FROM Win32_Printer&#8221;;<br />
      ObjectQuery objectQuery = new ObjectQuery(strQuery);<br />
      ManagementObjectSearcher query = new ManagementObjectSearcher(objectQuery);<br />
      ManagementObjectCollection queryCollection = query.Get();<br />
      foreach (ManagementObject managementObject in queryCollection)<br />
      {<br />
        PropertyDataCollection propertyDataCollection = managementObject.Properties;</p>
<p>        if ((bool)managementObject["Default"]) // DEFAULT PRINTER<br />
        {<br />
          return (managementObject["Name"].ToString ());<br />
          //Console.WriteLine(managementObject["Location"]);<br />
        }<br />
      }<br />
      return &#8220;&#8221;;<br />
    }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=135</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shut down system using C#</title>
		<link>http://www.systemicsonline.com/vision/?p=131</link>
		<comments>http://www.systemicsonline.com/vision/?p=131#comments</comments>
		<pubDate>Tue, 10 Nov 2009 20:51:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=131</guid>
		<description><![CDATA[This code shut downs the operating system using the System.Management assembly, but not before obtaining the required security privileges. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; // Remember to add a reference to the System.Management assembly using System.Management; namespace ShutDown { public partial class Form1 : Form { [...]]]></description>
			<content:encoded><![CDATA[<p>This code shut downs the operating system using the System.Management assembly, but not before obtaining the required security privileges.</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;</p>
<p>// Remember to add a reference to the System.Management assembly</p>
<p>using System.Management;<br />
namespace ShutDown<br />
{<br />
public partial class Form1 : Form<br />
{<br />
public Form1()</p>
<p>{</p>
<p>InitializeComponent();</p>
<p>}</p>
<p>private void btnShutDown_Click(object sender, EventArgs e)</p>
<p>{</p>
<p>ManagementBaseObject mboShutdown = null;</p>
<p>ManagementClass mcWin32 = new ManagementClass(&#8220;Win32_OperatingSystem&#8221;);</p>
<p>mcWin32.Get();</p>
<p>// You can&#8217;t shutdown without security privileges</p>
<p>mcWin32.Scope.Options.EnablePrivileges = true;</p>
<p>ManagementBaseObject mboShutdownParams = mcWin32.GetMethodParameters(&#8220;Win32Shutdown&#8221;);</p>
<p>// Flag 1 means we want to shut down the system</p>
<p>mboShutdownParams["Flags"] = &#8220;1&#8243;;</p>
<p>mboShutdownParams["Reserved"] = &#8220;0&#8243;;</p>
<p>foreach (ManagementObject manObj in mcWin32.GetInstances())</p>
<p>{</p>
<p>mboShutdown = manObj.InvokeMethod(&#8220;Win32Shutdown&#8221;, mboShutdownParams, null);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=131</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is your Memory Load Percentage?</title>
		<link>http://www.systemicsonline.com/vision/?p=128</link>
		<comments>http://www.systemicsonline.com/vision/?p=128#comments</comments>
		<pubDate>Tue, 13 Oct 2009 14:17:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=128</guid>
		<description><![CDATA[Here&#8217;s a console utility to print it out: &#8216; File: MemLoad.vb imports System.Runtime.InteropServices Module module_memoryload  structure MEMORYSTATUSEX    public Length as Integer    public MemoryLoad as Integer    public TotalPhys as LONG    public AvailPhys as LONG    public TotalPageFile as LONG    public AvailPageFile as LONG    public TotalVirtual as LONG    public AvailVirtual [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a console utility to print it out:</p>
<p>&#8216; File: MemLoad.vb<br />
imports System.Runtime.InteropServices</p>
<p>Module module_memoryload</p>
<p> structure MEMORYSTATUSEX<br />
   public Length as Integer<br />
   public MemoryLoad as Integer<br />
   public TotalPhys as LONG<br />
   public AvailPhys as LONG<br />
   public TotalPageFile as LONG<br />
   public AvailPageFile as LONG<br />
   public TotalVirtual as LONG<br />
   public AvailVirtual as LONG<br />
   public AvailExtendedVirtual as LONG<br />
 End Structure</p>
<p> Declare Function GlobalMemoryStatusEx lib &#8220;kernel32&#8243; _<br />
          (ByRef ms As MEMORYSTATUSEX) As Boolean</p>
<p> sub main(ByVal args() As String)<br />
   dim ms as new MemoryStatusEx<br />
   ms.Length =  Marshal.Sizeof(ms)<br />
   if GlobalMemoryStatusEx(ms) then<br />
      Console.WriteLine(&#8220;- Memory Load: {0}%&#8221;, ms.MemoryLoad)<br />
   end if<br />
 end sub</p>
<p>end Module</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Custom events</title>
		<link>http://www.systemicsonline.com/vision/?p=124</link>
		<comments>http://www.systemicsonline.com/vision/?p=124#comments</comments>
		<pubDate>Mon, 03 Aug 2009 17:28:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=124</guid>
		<description><![CDATA[Declaring new events: public class Service  {        public delegate void DataArrivalEventDelegate(string e);        public static event DataArrivalEventDelegate DataArrival;  } Firing The event: DataArrival(&#8220;Hallo&#8221;); Subscribing to the event: Service.DataArrival += new Service.DataArrivalEventDelegate(DataArrival);  void DataArrival(string message) { }]]></description>
			<content:encoded><![CDATA[<p><strong><em>Declaring new events:</em></strong></p>
<p>public class Service<br />
 {</p>
<p>       public delegate void DataArrivalEventDelegate(string e);<br />
       public static event DataArrivalEventDelegate DataArrival; </p>
<p>}</p>
<p><strong><em>Firing The event:</em></strong></p>
<p>DataArrival(&#8220;Hallo&#8221;);</p>
<p><strong><em>Subscribing to the event:</em></strong></p>
<p>Service.DataArrival += new Service.DataArrivalEventDelegate(DataArrival);</p>
<p> void DataArrival(string message)<br />
{<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSD Optimisations</title>
		<link>http://www.systemicsonline.com/vision/?p=122</link>
		<comments>http://www.systemicsonline.com/vision/?p=122#comments</comments>
		<pubDate>Thu, 23 Jul 2009 10:59:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=122</guid>
		<description><![CDATA[Increase System Speed Disable indexing Description: Indexing creates and maintains a database of file attributes. This can lead to multiple small writes when creating/deleting/modifying files. Searching for files will still work. Instructions: Start Menu -&#62; Right-Click Computer -&#62; Manage -&#62; Services and Applications -&#62; Services &#8211; &#62; Right-Click Windows Search -&#62; Startup type: Disabled -&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #004000;"><span style="text-decoration: underline;">Increase System Speed<br />
</span></span><span style="color: #800000;">Disable indexing</span></strong><br />
<strong>Description:</strong> Indexing creates and maintains a database of file attributes. This can lead to multiple small writes when creating/deleting/modifying files. Searching for files will still work.<br />
<strong>Instructions:</strong> Start Menu -&gt; Right-Click Computer -&gt; Manage -&gt; Services and Applications -&gt; Services &#8211; &gt; Right-Click Windows Search -&gt; Startup type: Disabled -&gt; OK</p>
<p><span style="color: #800000;"><strong>Disable defragmentation</strong></span><br />
<strong>Description:</strong> Defragmenting a hard disk&#8217;s used space is only useful on mechanical disks with multi-millisecond latencies. Free-space defragmentation may be useful to SSDs, but this feature is not available in the default Windows Defragmenter.<br />
<strong>Instructions:</strong> Start Menu -&gt; Right-Click Computer -&gt; Manage -&gt; Services and Applications -&gt; Services &#8211; &gt; Right-Click Disk Defragmenter -&gt; Startup type: Disabled -&gt; OK</p>
<p><span style="color: #800000;"><strong>Disable Write Caching</strong></span><br />
<strong>Description:</strong> There is no cache on the <acronym title="Solid State Drive">SSD</acronym>, so there are no benefits to write caching. There are conflicting reports on whether this gains speed or not.<br />
<strong>Instructions:</strong> Start Menu -&gt; Right-Click Computer -&gt; Manage -&gt; Device Manager -&gt; Disk drives -&gt; Right-Click STEC PATA -&gt; Properties -&gt; Policies Tab -&gt; Uncheck Enable write caching -&gt; OK</p>
<p><span style="color: #800000;"><strong>Configure Superfetch</strong></span><br />
<strong>Description:</strong> Frees up RAM by not preloading program files.<br />
<strong>Instructions:</strong> On second glance, I would recommend leaving this one alone. However, there are some customizations that you can follow in the post below.</p>
<p><span style="color: #800000;"><strong>Firefox &#8211; Use memory cache instead of disk cache</strong></span><br />
<strong>Description:</strong> If you use Firefox, there&#8217;s a way to write cached files to RAM instead of the hard disk. This is not only faster, but will significantly reduce writes to the <acronym title="Solid State Drive">SSD</acronym> while using the browser.<br />
<strong>Instructions:</strong> Open Firefox -&gt; Type about<strong></strong>:config into the address bar -&gt; Enter -&gt; double-click browser.cache.disk.enable to set the value to False -&gt; Right-Click anywhere -&gt; New -&gt; Integer -&gt; Preference Name &#8220;disk.cache.memory.capacity&#8221; -&gt; value memory size in KB. Enter 32768 for 32MB, 65536 for 64MB, 131072 for 128MB, etc. -&gt; restart Firefox</p>
<p><span style="color: #004000;"><span style="text-decoration: underline;"><strong>Free up extra drive space</strong></span></span><br />
<span style="color: #800000;"><strong>Disable the Page File</strong></span><br />
<strong>Description:</strong> Eliminate writing memory to the <acronym title="Solid State Drive">SSD</acronym>, free over 2GB of disk space. Warning &#8211; If you run out of memory the program you&#8217;re using will crash.<br />
<strong>Instructions:</strong> Start Menu -&gt; Right-Click Computer -&gt; Properties -&gt; Advanced System Settings -&gt; Settings (Performance) -&gt; Advanced Tab -&gt; Change -&gt; Uncheck Automatically manage -&gt; No paging file -&gt; Set -&gt; OK -&gt; Restart your computer<br />
Alternatively, if you want to play it safer, you can set a custom size of 200MB min and max.</p>
<p><span style="color: #800000;"><strong>Disable System Restore</strong></span><br />
<strong>Description:</strong> Don&#8217;t write backup copies of files when installing new programs or making system changes. Can free up between a few hundred MB to a couple GB. Warning &#8211; Although unlikely, if a driver installation corrupts your system, there won&#8217;t be an automatic way to recover.<br />
<strong>Instructions:</strong> Start Menu -&gt; Right-Click Computer -&gt; Properties -&gt; Advanced System Settings -&gt; System Protection Tab -&gt; Configure -&gt; Turn off system protection -&gt; Delete -&gt; OK</p>
<p><span style="color: #800000;"><strong>Disable Hibernate</strong></span><br />
<strong>Description:</strong> You may free up 1GB of space on the <acronym title="Solid State Drive">SSD</acronym> if you have 1GB of memory, 2GB of space if you have 2GB memory. You will lose the hibernation feature which allows the equivalent of quick boots and shutdowns.<br />
<strong>Instructions:</strong> Start Menu -&gt; Type cmd -&gt; Right-Click the cmd Icon -&gt; Run as Administrator -&gt; Type powercfg -h off -&gt; Type exit</p>
<p><!-- google_ad_section_end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=122</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Contact Detail Listing (C# , Google API, ASP.NET)</title>
		<link>http://www.systemicsonline.com/vision/?p=119</link>
		<comments>http://www.systemicsonline.com/vision/?p=119#comments</comments>
		<pubDate>Mon, 20 Jul 2009 13:13:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=119</guid>
		<description><![CDATA[Check out the following ASP.NET example for listing contact of a gmail account and adding a new contact to it. First download the Google Data API from the specified link and install it http://code.google.com/p/google-gdata/ Then create a new project and include following references in it Google.GData.Client.dll Google.GData.Contacts.dll Google.GData.Extensions.dll Then i created the following class using [...]]]></description>
			<content:encoded><![CDATA[<p>Check out the following ASP.NET example for listing contact of a gmail account and adding a new contact to it. First download the Google Data API from the specified link and install it</p>
<p><a href="http://code.google.com/p/google-gdata/">http://code.google.com/p/google-gdata/</a></p>
<p>Then create a new project and include following references in it</p>
<p>Google.GData.Client.dll<br />
Google.GData.Contacts.dll<br />
Google.GData.Extensions.dll</p>
<p>Then i created the following class<br />
using System;<br />
using System.Collections.Generic;<br />
using Google.GData.Contacts;<br />
using Google.GData.Extensions;</p>
<p>///<br />
/// Summary description for GoogleContactService<br />
///<br />
public class GoogleContactService<br />
{<br />
public static ContactsService GContactService = null;</p>
<p>public static void InitializeService(string username,<br />
string password)<br />
{<br />
GContactService = new ContactsService(&#8220;Contact Infomation&#8221;);<br />
GContactService.setUserCredentials(username, password);<br />
}</p>
<p>public static List&lt;ContactDetail&gt; GetAllContact()<br />
{<br />
List&lt;ContactDetail&gt; contactDetails = new List&lt;ContactDetail&gt;();<br />
ContactsQuery query = new ContactsQuery(ContactsQuery.<br />
CreateContactsUri(&#8220;default&#8221;));</p>
<p>ContactsFeed feed = GContactService.Query(query);<br />
foreach (ContactEntry entry in feed.Entries)<br />
{<br />
ContactDetail contact = new<br />
ContactDetail{Name = entry.Title.Text,<br />
EmailAddress1 = entry.Emails.Count &gt;= 1 ? entry.Emails[0].Address : &#8220;&#8221;,<br />
EmailAddress2 = entry.Emails.Count &gt;= 2 ? entry.Emails[1].Address : &#8220;&#8221;,<br />
Phone = entry.Phonenumbers.Count &gt;= 1 ? entry.Phonenumbers[0].Value : &#8220;&#8221;,<br />
Address =  entry.PostalAddresses.Count &gt;= 1 ? entry.PostalAddresses[0].Value : &#8220;&#8221;,<br />
Details = entry.Content.Content};</p>
<p>contactDetails.Add(contact);<br />
}</p>
<p>return contactDetails;<br />
}</p>
<p>public static void AddContact(ContactDetail contact)<br />
{<br />
ContactEntry newEntry = new ContactEntry();<br />
newEntry.Title.Text = contact.Name;</p>
<p>EMail primaryEmail = new EMail(contact.EmailAddress1);<br />
primaryEmail.Primary = true;<br />
primaryEmail.Rel = ContactsRelationships.IsWork;<br />
newEntry.Emails.Add(primaryEmail);</p>
<p>EMail secondaryEmail = new EMail(contact.EmailAddress2);<br />
secondaryEmail.Rel = ContactsRelationships.IsHome;<br />
newEntry.Emails.Add(secondaryEmail);</p>
<p>PhoneNumber phoneNumber = new PhoneNumber(contact.Phone);<br />
phoneNumber.Primary = true;<br />
phoneNumber.Rel = ContactsRelationships.IsMobile;<br />
newEntry.Phonenumbers.Add(phoneNumber);</p>
<p>PostalAddress postalAddress = new PostalAddress();<br />
postalAddress.Value = contact.Address;<br />
postalAddress.Primary = true;<br />
postalAddress.Rel = ContactsRelationships.IsHome;<br />
newEntry.PostalAddresses.Add(postalAddress);</p>
<p>newEntry.Content.Content = contact.Details;</p>
<p>Uri feedUri = new Uri(ContactsQuery.CreateContactsUri(&#8220;default&#8221;));</p>
<p>ContactEntry createdEntry = (ContactEntry)GContactService.Insert(feedUri, newEntry);<br />
}<br />
}</p>
<p>public class ContactDetail<br />
{<br />
public string Name { get; set; }<br />
public string EmailAddress1 { get; set; }<br />
public string EmailAddress2 { get; set; }<br />
public string Phone { get; set; }<br />
public string Address { get; set; }<br />
public string Details { get; set; }<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=119</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Read from XML File</title>
		<link>http://www.systemicsonline.com/vision/?p=115</link>
		<comments>http://www.systemicsonline.com/vision/?p=115#comments</comments>
		<pubDate>Mon, 20 Jul 2009 12:44:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.systemicsonline.com/vision/?p=115</guid>
		<description><![CDATA[private static DataTable GetXMLData(string DataTableToReturn) {       XmlDocument doc = new XmlDocument();       doc.Load(@&#8221;c:\filename.xml&#8221;);       DataSet ds = new DataSet();       ds.ReadXml(new XmlNodeReader(doc));       return ds.Tables[DataTableToReturn];  }]]></description>
			<content:encoded><![CDATA[<p>private static DataTable GetXMLData(string DataTableToReturn)<br />
{<br />
      XmlDocument doc = new XmlDocument();<br />
      doc.Load(@&#8221;c:\filename.xml&#8221;);</p>
<p>      DataSet ds = new DataSet();<br />
      ds.ReadXml(new XmlNodeReader(doc));<br />
      return ds.Tables[DataTableToReturn];<br />
 }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systemicsonline.com/vision/?feed=rss2&amp;p=115</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
