<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>C# Forum RSS Feed (Replies Included)</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the 'C#' forum at Programmer's Heaven, including replies.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 11:24:59 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 11:24:59 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Internal Service Error 500 when posting FormData to web service</title>
      <link>http://www.programmersheaven.com/mb/csharp/432094/432094/internal-service-error-500-when-posting-formdata-to-web-service/</link>
      <description>Hello all,&lt;br /&gt;
&lt;br /&gt;
I am attempting to upload a file from a HTML page to my C# Web service using XMLHTTPRequest to post FormData to my Web Service that is expecting a byte array.&lt;br /&gt;
&lt;br /&gt;
My other XMLHTTPRequest posts from my HTML Javascript work, however there is something I don't understand about posting files to C# Web Service using FormData.&lt;br /&gt;
&lt;br /&gt;
My javascript XMLHTTPRequest reports state change to 0 and then &lt;strong&gt;Internal Service Error 500&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
I've been trying for days and I ask out of desperation. Can anyone help?&lt;br /&gt;
&lt;br /&gt;
Here are the important snippets. I'll add error trapping and different browser support once I can get the basics to work:&lt;br /&gt;
&lt;br /&gt;
My HTML:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;    &amp;lt;input id="htmlinputfile" type="file" name="htmlinputfile" /&amp;gt;
    &amp;lt;input type="button" value="Upload" onclick="uploadFile()" /&amp;gt;   &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
My Javascript:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;function uploadFile() {

     var file = document.getElementById('htmlinputfile').files[0];   // Get the single file from the html input field.
     var formData = new FormData();
     formData.append('file', file);                        // Append the file to the form data.
     var request = new XMLHttpRequest();                       // I am only using firefox, so no need to worry about ie.

     request.onreadystatechange = function () {
         alert("status:" + request.status + " " + request.statusText);         // Displays 0 and then the 500 Internal Service Error.
         if (request.readyState == 4 &amp;amp;&amp;amp; request.status == 200) {
             alert("Upload successful!");
         }
     }

     request.open("POST", 'http://localhost:59541/WebService.asmx/Upload', true);    
     request.send(formData);&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
My C# Web Service:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;using System;
using System.Web.Services;
using System.IO;

namespace MouseEditor
{
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    [System.Web.Script.Services.ScriptService]
    public class WebService : System.Web.Services.WebService
    {
        [WebMethod]
        public String Upload(byte[] bytes)
        {
            return "This is a test";
        }
    }
}&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/432094/432094/internal-service-error-500-when-posting-formdata-to-web-service/</guid>
      <pubDate>Wed, 15 May 2013 22:22:37 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Internal Service Error 500 when posting FormData to web service</title>
      <link>http://www.programmersheaven.com/mb/csharp/432093/432093/internal-service-error-500-when-posting-formdata-to-web-service/</link>
      <description>Hello all,&lt;br /&gt;
&lt;br /&gt;
I am attempting to upload a file from a HTML page to my C# Web service using XMLHTTPRequest to post FormData to my Web Service that is expecting a byte array.&lt;br /&gt;
&lt;br /&gt;
My other XMLHTTPRequest posts from my HTML Javascript work, however there is something I don't understand about posting files to C# Web Service using FormData.&lt;br /&gt;
&lt;br /&gt;
My javascript XMLHTTPRequest reports state change to 0 and then &lt;strong&gt;Internal Service Error 500&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
I've been trying for days and I ask out of desperation. Can anyone help?&lt;br /&gt;
&lt;br /&gt;
Here are the important snippets. I'll add error trapping and different browser support once I can get the basics to work:&lt;br /&gt;
&lt;br /&gt;
My HTML:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;    &amp;lt;input id="htmlinputfile" type="file" name="htmlinputfile" /&amp;gt;
    &amp;lt;input type="button" value="Upload" onclick="uploadFile()" /&amp;gt;   &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
My Javascript:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;function uploadFile() {

     var file = document.getElementById('htmlinputfile').files[0];   // Get the single file from the html input field.
     var formData = new FormData();
     formData.append('file', file);                        // Append the file to the form data.
     var request = new XMLHttpRequest();                       // I am only using firefox, so no need to worry about ie.

     request.onreadystatechange = function () {
         alert("status:" + request.status + " " + request.statusText);         // Displays 0 and then the 500 Internal Service Error.
         if (request.readyState == 4 &amp;amp;&amp;amp; request.status == 200) {
             alert("Upload successful!");
         }
     }

     request.open("POST", 'http://localhost:59541/WebService.asmx/Upload', true);    
     request.send(formData);&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
My C# Web Service:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;using System;
using System.Web.Services;
using System.IO;

namespace MouseEditor
{
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    [System.Web.Script.Services.ScriptService]
    public class WebService : System.Web.Services.WebService
    {
        [WebMethod]
        public String Upload(byte[] bytes)
        {
            return "This is a test";
        }
    }
}&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/432093/432093/internal-service-error-500-when-posting-formdata-to-web-service/</guid>
      <pubDate>Wed, 15 May 2013 22:20:04 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>for delete</title>
      <link>http://www.programmersheaven.com/mb/csharp/432028/432028/for-delete/</link>
      <description>needs to be deleted, i made double post</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/432028/432028/for-delete/</guid>
      <pubDate>Sat, 11 May 2013 16:32:38 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>drawing on the panel and scrolling the result</title>
      <link>http://www.programmersheaven.com/mb/csharp/432027/432027/drawing-on-the-panel-and-scrolling-the-result/</link>
      <description>I have problem with showing a diagram which is too big to see on one panel. &lt;br /&gt;
I have to scrollbars which should change the point of view on the diagram, but when i want to scroll the picture, the shapes are moving on the different position, everything getting crushed. &lt;br /&gt;
&lt;br /&gt;
it looks like this &lt;img src="http://i39.tinypic.com/wqveg.jpg" /&gt;&lt;br /&gt;
&lt;br /&gt;
when i show it,and like this&lt;br /&gt;
&lt;img src="http://i44.tinypic.com/4i1ysh.jpg" /&gt; &lt;br /&gt;
 when i try to look on the bottom of the graph  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
it looks like application drawing the shapes every time when i scroll the panel, and when i go on the bottom of picture the point on the top left corner still is (0,0) not (0,500)&lt;br /&gt;
&lt;br /&gt;
I have algorithm, which giving value of location on the panel and nr id of object to the array, then i have the loop which drawing it, getting info from dictionary about the object and his position from array. &lt;br /&gt;
&lt;br /&gt;
How this problem can be solved ?&lt;br /&gt;
&lt;br /&gt;
Thx for any advice's  &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/432027/432027/drawing-on-the-panel-and-scrolling-the-result/</guid>
      <pubDate>Sat, 11 May 2013 16:29:17 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: Convert word file to PDF</title>
      <link>http://www.programmersheaven.com/mb/csharp/428424/431980/re-convert-word-file-to-pdf/#431980</link>
      <description>i always meet the problems of such image conversion, so i always look for a good &lt;a href="http://www.rasteredge.com/how-to/csharp-imaging/pdf-convert-word/"&gt;image converter&lt;/a&gt; on the internet . among the lots of converters i have used , i found this converter is good and it can do word to pdf conversion, if you haven't found a better way to do that , you can have a try.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/428424/431980/re-convert-word-file-to-pdf/#431980</guid>
      <pubDate>Tue, 07 May 2013 19:51:28 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>User Control - DataGridView with combobox columns</title>
      <link>http://www.programmersheaven.com/mb/csharp/431971/431971/user-control---datagridview-with-combobox-columns/</link>
      <description>Trying to build a simple User Control to populate dataGridView with a Table data. Scenario - Table1: RegionID, Region, ManagerID; Table2: PersonID, Name. I'd like to display Region and Name in the grid where the 2nd column is a combobox with all names from Table 2 and also each cell in the col 2 has value based on ManagerID = PersonID. The code is working fine when it's a win app without user control.&lt;br /&gt;
&lt;br /&gt;
dGrRegions.DataSource = ds.Tables[0]; (ds Dataset SELECT RegionID, Region, ManagerID FROM Table1)&lt;br /&gt;
&lt;br /&gt;
dGrRegions.Columns[0].Visible = false;&lt;br /&gt;
dGrRegions.Columns[2].Visible = false;&lt;br /&gt;
&lt;br /&gt;
var column = new DataGridViewComboBoxColumn();&lt;br /&gt;
column.DataPropertyName = "PersonID";&lt;br /&gt;
&lt;br /&gt;
column.DataSource = dsPeople.Tables[0]; (Dataset SELECT PersonID, Name...)&lt;br /&gt;
column.ValueMember = "PersonID";&lt;br /&gt;
column.DisplayMember = "Name";&lt;br /&gt;
column.HeaderText = "Manager";&lt;br /&gt;
&lt;br /&gt;
dGrRegions.Columns.Add(column);&lt;br /&gt;
&lt;br /&gt;
but when I create a control and pass all needed info as parameters all works fine except that the col 2 doesn't show current values (combo list is built ok)&lt;br /&gt;
&lt;br /&gt;
Any idea? &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431971/431971/user-control---datagridview-with-combobox-columns/</guid>
      <pubDate>Mon, 06 May 2013 06:31:59 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Add value from Textbox to xml file</title>
      <link>http://www.programmersheaven.com/mb/csharp/431949/431949/add-value-from-textbox-to-xml-file/</link>
      <description>Hello,&lt;br /&gt;
I've already done the work load.. but its not what i wanted&lt;br /&gt;
The thing is that, the value input from the textboxes are stored in the xml file&lt;br /&gt;
&lt;br /&gt;
I have this Xml file structure:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&amp;lt;Contacts xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&amp;gt;
    &amp;lt;Contact&amp;gt;
        &amp;lt;FirstName&amp;gt;sample&amp;lt;/FirstName&amp;gt;
        &amp;lt;MidName&amp;gt;sample&amp;lt;/MidName&amp;gt;
        &amp;lt;LastName&amp;gt;sample&amp;lt;/LastName&amp;gt;
        &amp;lt;Age&amp;gt;20&amp;lt;/Age&amp;gt;
        &amp;lt;Address&amp;gt;
            &amp;lt;City&amp;gt;sample&amp;lt;/City&amp;gt;
            &amp;lt;Street&amp;gt;sample&amp;lt;/Street&amp;gt;
            &amp;lt;State&amp;gt;sample&amp;lt;/State&amp;gt;
            &amp;lt;Country&amp;gt;sample&amp;lt;/Country&amp;gt;
        &amp;lt;/Address&amp;gt;
        &amp;lt;Phone&amp;gt;
            &amp;lt;Mobile&amp;gt;1234567&amp;lt;/Mobile&amp;gt;
            &amp;lt;Home&amp;gt;7654321&amp;lt;/Home&amp;gt;
            &amp;lt;Office&amp;gt;7894561&amp;lt;/Office&amp;gt;
        &amp;lt;/Phone&amp;gt;
        &amp;lt;Company&amp;gt;
            &amp;lt;Name&amp;gt;sample&amp;lt;/Name&amp;gt;
            &amp;lt;Department&amp;gt;IT Technician&amp;lt;/Department&amp;gt;
        &amp;lt;/Company&amp;gt;
        &amp;lt;Email&amp;gt;xyz@xxx.com&amp;lt;/Email&amp;gt;
    &amp;lt;/Contact&amp;gt;
&amp;lt;/Contacts&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
but in my output, i'm getting this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&amp;lt;Contacts&amp;gt;
  &amp;lt;contact&amp;gt;
    &amp;lt;FirstName&amp;gt;sample&amp;lt;/FirstName&amp;gt;
    &amp;lt;MidName&amp;gt;sample&amp;lt;/MidName&amp;gt;
    &amp;lt;LastName&amp;gt;sample&amp;lt;/LastName&amp;gt;
    &amp;lt;Age&amp;gt;20&amp;lt;/Age&amp;gt;
    &amp;lt;City&amp;gt;sample&amp;lt;/City&amp;gt;
    &amp;lt;Street&amp;gt;sample&amp;lt;/Street&amp;gt;
    &amp;lt;State&amp;gt;sample&amp;lt;/State&amp;gt;
    &amp;lt;Country&amp;gt;sample&amp;lt;/Country&amp;gt;
    &amp;lt;Mobile&amp;gt;1234567&amp;lt;/Mobile&amp;gt;
    &amp;lt;Home&amp;gt;7894561&amp;lt;/Home&amp;gt;
    &amp;lt;Office&amp;gt;1122334&amp;lt;/Office&amp;gt;
    &amp;lt;Company&amp;gt;sample&amp;lt;/Company&amp;gt;
    &amp;lt;Name&amp;gt;sample&amp;lt;/Name&amp;gt;
    &amp;lt;Department&amp;gt;IT Technician&amp;lt;/Department&amp;gt;
    &amp;lt;Email&amp;gt;xyz@xxx.com&amp;lt;/Email&amp;gt;
  &amp;lt;/contact&amp;gt;
&amp;lt;Contacts&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Here's my Interface:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&amp;lt;asp:GridView ID="gvProducts" AutoGenerateColumns="False" CssClass="GridViewStyle"
        runat="server" OnRowCommand="gvProducts_RowCommand" OnRowEditing="gvProducts_RowEditing"
        OnRowCancelingEdit="gvProducts_RowCancelingEdit" OnRowUpdating="gvProducts_RowUpdating"
        OnRowDeleting="gvProducts_RowDeleting" AllowPaging="True" 
        AllowSorting="True" &amp;gt;
        &amp;lt;RowStyle CssClass="RowStyle" /&amp;gt;
        &amp;lt;FooterStyle CssClass="RowStyle" /&amp;gt;
        &amp;lt;SelectedRowStyle CssClass="SelectedRowStyle" /&amp;gt;
        &amp;lt;HeaderStyle CssClass="HeaderStyle" /&amp;gt;
        &amp;lt;AlternatingRowStyle CssClass="AltRowStyle" /&amp;gt;
        &amp;lt;Columns&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="First Name"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("FirstName")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewFname" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtFname" Text='&amp;lt;%#Eval("FirstName")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Mid Name"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("MidName")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewMname" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtMname" Text='&amp;lt;%#Eval("MidName")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Last Name"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("LastName")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtLname" Text='&amp;lt;%#Eval("LastName")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewLname" runat="server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Age"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Age")%&amp;gt;
                &amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtAge" Text='&amp;lt;%#Eval("Age")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewAge" runat="server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="City"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("City")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewCity" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtCity" Text='&amp;lt;%#Eval("City")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Street"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Street")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewStreet" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtStreet" Text='&amp;lt;%#Eval("Street")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="State"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("State")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewState" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtState" Text='&amp;lt;%#Eval("State")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Country"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Country")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewCountry" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtCountry" Text='&amp;lt;%#Eval("Country")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Mobile No."&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Mobile")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewMobile" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtMobile" Text='&amp;lt;%#Eval("Mobile")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Home No."&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Home")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewHome" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtHome" Text='&amp;lt;%#Eval("Home")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Office No."&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Office")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewOffice" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtOffice" Text='&amp;lt;%#Eval("Office")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Company"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Company")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewCompany" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtCompany" Text='&amp;lt;%#Eval("Company")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Company Name"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Name")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewName" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtName" Text='&amp;lt;%#Eval("Name")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="Department"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Department")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewDepartment" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtDepartment" Text='&amp;lt;%#Eval("Department")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField HeaderText="E-mail Address"&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;%#Eval("Email")%&amp;gt;&amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtNewEmail" runat="Server" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txtEmail" Text='&amp;lt;%#Eval("Email")%&amp;gt;' runat="server" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;asp:TemplateField&amp;gt;
                &amp;lt;ItemTemplate&amp;gt;
                    &amp;lt;asp:LinkButton ID="btnedit" runat="server" CommandName="Edit" Text="Edit" /&amp;gt;
                &amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;EditItemTemplate&amp;gt;
                    &amp;lt;asp:LinkButton ID="btnupdate" runat="server" CommandName="Update" Text="Update" /&amp;gt;
                    &amp;lt;asp:LinkButton ID="btncancel" runat="server" CommandName="Cancel" Text="Cancel" /&amp;gt;
                    &amp;lt;asp:LinkButton ID="btnDelete" runat="server" CommandName="Delete" Text="Delete" /&amp;gt;
                &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;FooterTemplate&amp;gt;
                    &amp;lt;asp:LinkButton ID="btnInsert" runat="Server" Text="Insert" CommandName="Insert"
                        UseSubmitBehavior="False" /&amp;gt;
                &amp;lt;/FooterTemplate&amp;gt;
            &amp;lt;/asp:TemplateField&amp;gt;
        &amp;lt;/Columns&amp;gt;
    &amp;lt;/asp:GridView&amp;gt;
    &amp;lt;br /&amp;gt;
    &amp;lt;asp:LinkButton ID="btnAdd" runat="server" Text="Add" OnClick="AddNewRecord" /&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Here's my Code Behind in C#:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;

public partial class xmlContact1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
            BindData();
    }

    private void BindData()
    {
        //bind the gridview
        gvProducts.DataSource = RetrieveProducts();
        gvProducts.DataBind();
    }

    private DataSet RetrieveProducts()
    {
        //if the products data is already saved in viewstate
        //return that data
        if (ViewState["Contacts"] != null)
            return ViewState["Contacts"] as DataSet;

        DataSet dsProducts = new DataSet();

        //read the xml schema
        //dsProducts.ReadXmlSchema(Server.MapPath(@"XML\Co
ntacts.xsd"));

        //read the xml data
        dsProducts.ReadXml(Server.MapPath(@"XML\Contacts.x
ml"));

        //store the data into viewstate which will be used for
        //subsequent postbacks
        ViewState["Contacts"] = dsProducts;

        return dsProducts;
    }

    protected void AddNewRecord(object sender, EventArgs e)
    {
        gvProducts.ShowFooter = true;
        BindData();
    }

    protected void gvProducts_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        // If multiple ButtonField column fields are used, use the
        // CommandName property to determine if "Insert" button was clicked.
        if (e.CommandName.Equals("Insert"))
        {
            //fetch the values of the new product
            TextBox txtNewFname = gvProducts.FooterRow.FindControl("txtNewFname") as TextBox;
            TextBox txtNewMname= gvProducts.FooterRow.FindControl("txtNewMname") as TextBox;
            TextBox txtNewLname= gvProducts.FooterRow.FindControl("txtNewLname") as TextBox;
            TextBox txtNewAge = gvProducts.FooterRow.FindControl("txtNewAge") as TextBox;
            TextBox txtNewCity = gvProducts.FooterRow.FindControl("txtNewCity") as TextBox;
            TextBox txtNewStreet = gvProducts.FooterRow.FindControl("txtNewStreet") as TextBox;
            TextBox txtNewState = gvProducts.FooterRow.FindControl("txtNewState") as TextBox;
            TextBox txtNewCountry = gvProducts.FooterRow.FindControl("txtNewCountry") as TextBox;
            TextBox txtNewMobile = gvProducts.FooterRow.FindControl("txtNewMobile") as TextBox;
            TextBox txtNewHome = gvProducts.FooterRow.FindControl("txtNewHome") as TextBox;
            TextBox txtNewOffice = gvProducts.FooterRow.FindControl("txtNewOffice") as TextBox;
            TextBox txtNewCompany = gvProducts.FooterRow.FindControl("txtNewCompany") as TextBox;
            TextBox txtNewName = gvProducts.FooterRow.FindControl("txtNewName") as TextBox;
            TextBox txtNewDepartment = gvProducts.FooterRow.FindControl("txtNewDepartment
") as TextBox;
            TextBox txtNewEmail = gvProducts.FooterRow.FindControl("txtNewEmail") as TextBox;

            //insert the new product
            InsertProduct(txtNewFname.Text, txtNewMname.Text, txtNewLname.Text, txtNewAge.Text, txtNewCity.Text, txtNewStreet.Text, txtNewState.Text, txtNewCountry.Text, txtNewMobile.Text, txtNewHome.Text, txtNewOffice.Text, txtNewCompany.Text, txtNewName.Text, txtNewDepartment.Text, txtNewEmail.Text);

            //hide the footer
            gvProducts.ShowFooter = false;

            //clear the view state so that latest list will be retrieved from file
            ViewState["Contacts"] = null;

            // rebind the data
            BindData();
        }
    }

    private void InsertProduct(string FirstName, string MidName, string LastName, string Age, string City, string Street, string State, string Country, string Mobile, string Home, string Office, string Company, string Name, string Department, string Email)
    {
        //get the product data from viewstate
        DataSet dsProducts = ViewState["Contacts"] as DataSet;

        //create a new product row and populate it with user input data
        DataRow newProductRow = dsProducts.Tables[0].NewRow();
        
        newProductRow["FirstName"] = FirstName;
        newProductRow["MidName"] = MidName;
        newProductRow["LastName"] = LastName;
        newProductRow["Age"] = Age;
        newProductRow["City"] = City;
        newProductRow["Street"] = Street;
        newProductRow["State"] = State;
        newProductRow["Country"] = Country;
        newProductRow["Mobile"] = Mobile;
        newProductRow["Home"] = Home;
        newProductRow["Office"] = Office;
        newProductRow["Company"] = Company;
        newProductRow["Name"] = Name;
        newProductRow["Department"] = Department;
        newProductRow["Email"] = Email;
        dsProducts.Tables[0].Rows.Add(newProductRow);

        //write the data back to the XML file
        dsProducts.WriteXml(GetXMLSourcePath());

        //store the new product dataset into the viewstate
        ViewState["Products"] = dsProducts;
        BindData();

    }

    private string GetXMLSourcePath()
    {
        return Server.MapPath(@"XML\Contacts.xml");
    }

    protected void gvProducts_RowEditing(object sender, GridViewEditEventArgs e)
    {
        gvProducts.EditIndex = e.NewEditIndex;
        BindData();
    }

    protected void gvProducts_RowUpdating(Object sender, GridViewUpdateEventArgs e)
    {
        // Get the product id of the selected product   
        string ID = gvProducts.DataKeys[e.RowIndex].Value.ToString();

        // Get the GridViewRow object that represents the row being edited
        // from the Rows collection of the GridView control.           
        GridViewRow row = gvProducts.Rows[e.RowIndex];

        // Get the controls that contain the updated values. In this example, the updated values are contained   
        //in the TextBox controls declared in the edit item templates of each TemplateField
        // column fields in the GridView control.
        TextBox txtFname= (TextBox)row.FindControl("txtFname");
        TextBox txtMname= (TextBox)row.FindControl("txtMname");
        TextBox txtLname= (TextBox)row.FindControl("txtLname");
        TextBox txtAge= (TextBox)row.FindControl("txtAge");
        TextBox txtCity = (TextBox)row.FindControl("txtCity");
        TextBox txtStreet = (TextBox)row.FindControl("txtStreet");
        TextBox txtState = (TextBox)row.FindControl("txtState");
        TextBox txtCountry = (TextBox)row.FindControl("txtCountry");
        TextBox txtMobile = (TextBox)row.FindControl("txtMobile");
        TextBox txtHome = (TextBox)row.FindControl("txtHome");
        TextBox txtOffice = (TextBox)row.FindControl("txtOffice");
        TextBox txtCompany = (TextBox)row.FindControl("txtCompany");
        TextBox txtName = (TextBox)row.FindControl("txtName");
        TextBox txtDepartment = (TextBox)row.FindControl("txtDepartment");
        TextBox txtEmail = (TextBox)row.FindControl("txtEmail");

        //update the product row
        DataSet dsProducts = ViewState["Contacts"] as DataSet;
        dsProducts.Tables[0].Rows[e.RowIndex]["FirstName"] = txtFname.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["MidName"] = txtMname.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["LastName"] = txtLname.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Age"] = txtAge.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["City"] = txtCity.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Street"] = txtStreet.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["State"] = txtState.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Country"] = txtCountry.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Mobile"] = txtMobile.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Home"] = txtHome.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Office"] = txtOffice.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Company"] = txtCompany.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Name"] = txtName.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Department"
] = txtDepartment.Text;
        dsProducts.Tables[0].Rows[e.RowIndex]["Email"] = txtEmail.Text;

        //persiste changes back to the xml data file
        dsProducts.WriteXml(GetXMLSourcePath());

        //store the latest dataset into viewstate
        ViewState["Contacts"] = dsProducts;

        //set gridview back to normal mode
        gvProducts.EditIndex = -1;

        //rebind gridview with latest data
        BindData();
    }

    protected void gvProducts_RowDeleting(Object sender, GridViewDeleteEventArgs e)
    {
        //get the dataset stored from the viewstate
        DataSet dsProducts = ViewState["Contacts"] as DataSet;

        //delete the row from the dataset
        dsProducts.Tables[0].Rows[e.RowIndex].Delete();

        //write those changes to XML data file and save latest dataset to viewstate
        dsProducts.WriteXml(GetXMLSourcePath());
        ViewState["Contacts"] = dsProducts;

        //change gridview back to normal window
        gvProducts.EditIndex = -1;

        //rebind the gridview with latest data
        BindData();
    }

    protected void gvProducts_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        gvProducts.EditIndex = -1;
        BindData();
    }

    
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Please help me to get this right&lt;br /&gt;
Thank You&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431949/431949/add-value-from-textbox-to-xml-file/</guid>
      <pubDate>Mon, 22 Apr 2013 03:57:03 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>KeyPress Event doesn't copy last character from text box.</title>
      <link>http://www.programmersheaven.com/mb/csharp/431931/431931/keypress-event-doesnt-copy-last-character-from-text-box/</link>
      <description>Situation: &lt;br /&gt;
A form has a text box in which the user must type some text. This text box has a KeyPress event in which the Form's text property changes to the text that the user types with each keystroke. &lt;br /&gt;
&lt;br /&gt;
Here's the code for the textbox's KeyPress Event:&lt;br /&gt;
&lt;br /&gt;
 private void tbGameTitle_KeyPress(object sender, KeyPressEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            this.Text = textBox1.Text;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Problem:&lt;br /&gt;
The last character the user types doesn't get copied to the Form's text. Example:&lt;br /&gt;
&lt;br /&gt;
textBox1.Text = "The War of 1812"&lt;br /&gt;
Form2.Text = "The War of 181"&lt;br /&gt;
&lt;br /&gt;
The "2" at the end of textBox1.Text doesn't get copied! How can I get the whole text string to copy to the form's text?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431931/431931/keypress-event-doesnt-copy-last-character-from-text-box/</guid>
      <pubDate>Sun, 14 Apr 2013 14:05:13 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Open a child form from another child form.</title>
      <link>http://www.programmersheaven.com/mb/csharp/431909/431909/open-a-child-form-from-another-child-form/</link>
      <description>The Scene: I'm working on an app in which the user chooses an option on one child form, which opens another child form. (Hint: both of these child forms are children of a Main Form. User clicks File/New on Main Menu of Main Form, which opens the first child form, which in turn opens a second child form.)&lt;br /&gt;
&lt;br /&gt;
The step by step:&lt;br /&gt;
&lt;br /&gt;
1. On MainForm, user clicks File/New Project from Main Menu. A child form called "Choose a project type" pops up on the screen. The user selects a project option on this form, clicks OK button, the "Choose a project type" child form disappears and a new child form called "Project 1" appears.&lt;br /&gt;
&lt;br /&gt;
Problem: The "Project 1" child form isn't a child of Main Form like it's supposed to be. How do I fix that?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431909/431909/open-a-child-form-from-another-child-form/</guid>
      <pubDate>Fri, 12 Apr 2013 12:54:43 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Open a child form from another child form.</title>
      <link>http://www.programmersheaven.com/mb/csharp/431908/431908/open-a-child-form-from-another-child-form/</link>
      <description>The Scene: I'm working on an app in which the user chooses an option on one child form, which opens another child form. (Hint: both of these child forms are children of a Main Form. User clicks File/New on Main Menu of Main Form, which opens the first child form, which in turn opens a second child form.)&lt;br /&gt;
&lt;br /&gt;
The step by step:&lt;br /&gt;
&lt;br /&gt;
1. On MainForm, user clicks File/New Project from Main Menu. A child form called "Choose a project type" pops up on the screen. The user selects a project option on this form, clicks OK button, the "Choose a project type" child form disappears and a new child form called "Project 1" appears.&lt;br /&gt;
&lt;br /&gt;
Problem: The "Project 1" child form isn't a child of Main Form like it's supposed to be. How do I fix that?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431908/431908/open-a-child-form-from-another-child-form/</guid>
      <pubDate>Fri, 12 Apr 2013 12:45:59 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: A simle way to generate Datamatrix barcode using C#</title>
      <link>http://www.programmersheaven.com/mb/csharp/430728/431897/re-a-simle-way-to-generate-datamatrix-barcode-using-c/#431897</link>
      <description>Here is the sample Code I have used to &lt;a href="http://www.onbarcode.com/csharp/data-matrix-generator.html"&gt;create Data Matrix barcode in C#&lt;/a&gt;:&lt;br /&gt;
using System;&lt;br /&gt;
   using System.Collections.Generic;&lt;br /&gt;
   using System.Text;&lt;br /&gt;
   using OnBarcode.Barcode;&lt;br /&gt;
   using System.Drawing.Imaging;&lt;br /&gt;
   using System.Drawing;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   DataMatrix datamatrix = new DataMatrix();&lt;br /&gt;
&lt;br /&gt;
   // Barcode data to encode&lt;br /&gt;
   datamatrix.Data = "OnBarcode";&lt;br /&gt;
   // Data Matrix data mode&lt;br /&gt;
   datamatrix.DataMode = DataMatrixDataMode.ASCII;&lt;br /&gt;
   // Data Matrix format mode&lt;br /&gt;
   datamatrix.FormatMode = DataMatrixFormatMode.Format_16X16;&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
   * Barcode Image Related Settings&lt;br /&gt;
   */&lt;br /&gt;
   // Unit of meature for all size related setting in the library. &lt;br /&gt;
   datamatrix.UOM = UnitOfMeasure.PIXEL;&lt;br /&gt;
   // Bar module size (X), default is 3 pixel;&lt;br /&gt;
   datamatrix.X = 3;&lt;br /&gt;
   // Barcode image left, right, top, bottom margins. Defaults are 0.&lt;br /&gt;
   datamatrix.LeftMargin = 0;&lt;br /&gt;
   datamatrix.RightMargin = 0;&lt;br /&gt;
   datamatrix.TopMargin = 0;&lt;br /&gt;
   datamatrix.BottomMargin = 0;&lt;br /&gt;
   // Image resolution in dpi, default is 72 dpi.&lt;br /&gt;
   datamatrix.Resolution = 72;&lt;br /&gt;
   // Created barcode orientation. &lt;br /&gt;
   //4 options are: facing left, facing right, facing bottom, and facing top&lt;br /&gt;
   datamatrix.Rotate = Rotate.Rotate0;&lt;br /&gt;
&lt;br /&gt;
   // Generate data matrix and encode barcode to gif format&lt;br /&gt;
   datamatrix.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif;&lt;br /&gt;
   datamatrix.drawBarcode("C:\\datamatrix.gif");&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
   You can also call other drawing methods to generate barcodes&lt;br /&gt;
             &lt;br /&gt;
   public void drawBarcode(Graphics graphics);&lt;br /&gt;
    &lt;br /&gt;
   public void drawBarcode(string filename);&lt;br /&gt;
    &lt;br /&gt;
   public Bitmap drawBarcode();&lt;br /&gt;
    &lt;br /&gt;
   public void drawBarcode(Stream stream);&lt;br /&gt;
             &lt;br /&gt;
   */&lt;br /&gt;
The &lt;a href="http://www.onbarcode.com/tutorial/csharp-barcode-encoding-data.html"&gt;C# barcode data encoding guide&lt;/a&gt; is very helpful. &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/430728/431897/re-a-simle-way-to-generate-datamatrix-barcode-using-c/#431897</guid>
      <pubDate>Thu, 11 Apr 2013 20:19:46 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: A simle way to generate Datamatrix barcode using C#</title>
      <link>http://www.programmersheaven.com/mb/csharp/430728/431867/re-a-simle-way-to-generate-datamatrix-barcode-using-c/#431867</link>
      <description>I have ever used the following codes to &lt;a href="http://www.barcodelib.com/csharp/barcode_symbologies/data_matrix.html"&gt;generate DataMatrix barcode&lt;/a&gt; image sucessfully. It's also very simple.&lt;br /&gt;
BarcodeLib.Barcode.DataMatrix datamatrix = new       BarcodeLib.Barcode.DataMatrix();&lt;br /&gt;
     datamatrix.Data = "1dfefg%^7fdsg56566";&lt;br /&gt;
&lt;br /&gt;
     datamatrix.BackgroundColor = System.Drawing.Color.White;&lt;br /&gt;
     datamatrix.ModuleSize =6;&lt;br /&gt;
     datamatrix.RightMargin = 6;&lt;br /&gt;
     datamatrix.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     // save barcode image into your system&lt;br /&gt;
     datamatrix.drawBarcode("c:/datamatrix.jpeg");&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode &amp;amp; output to byte array&lt;br /&gt;
     byte[] barcodeInBytes = datamatrix.drawBarcodeAsBytes();&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode to Graphics object&lt;br /&gt;
     Graphics graphics = ...;&lt;br /&gt;
     datamatrix.drawBarcode(graphics);&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode and output to HttpResponse object&lt;br /&gt;
     HttpResponse response = ...;&lt;br /&gt;
     datamatrix drawBarcode(response);&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode and output to Stream object&lt;br /&gt;
     Stream stream = ...;&lt;br /&gt;
     datamatrix drawBarcode(stream);&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/430728/431867/re-a-simle-way-to-generate-datamatrix-barcode-using-c/#431867</guid>
      <pubDate>Wed, 10 Apr 2013 20:42:44 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: A simle way to generate Datamatrix barcode using C#</title>
      <link>http://www.programmersheaven.com/mb/csharp/430728/431866/re-a-simle-way-to-generate-datamatrix-barcode-using-c/#431866</link>
      <description>I have ever used the following codes to &lt;a href="http://www.barcodelib.com/csharp/barcode_symbologies/data_matrix.html"&gt;generate DataMatrix barcode&lt;/a&gt; image sucessfully. It's also very simple.&lt;br /&gt;
BarcodeLib.Barcode.DataMatrix datamatrix = new       BarcodeLib.Barcode.DataMatrix();&lt;br /&gt;
     datamatrix.Data = "1dfefg%^7fdsg56566";&lt;br /&gt;
&lt;br /&gt;
     datamatrix.BackgroundColor = System.Drawing.Color.White;&lt;br /&gt;
     datamatrix.ModuleSize =6;&lt;br /&gt;
     datamatrix.RightMargin = 6;&lt;br /&gt;
     datamatrix.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     // save barcode image into your system&lt;br /&gt;
     datamatrix.drawBarcode("c:/datamatrix.jpeg");&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode &amp;amp; output to byte array&lt;br /&gt;
     byte[] barcodeInBytes = datamatrix.drawBarcodeAsBytes();&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode to Graphics object&lt;br /&gt;
     Graphics graphics = ...;&lt;br /&gt;
     datamatrix.drawBarcode(graphics);&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode and output to HttpResponse object&lt;br /&gt;
     HttpResponse response = ...;&lt;br /&gt;
     datamatrix drawBarcode(response);&lt;br /&gt;
&lt;br /&gt;
     // Encode datamatrix barcode and output to Stream object&lt;br /&gt;
     Stream stream = ...;&lt;br /&gt;
     datamatrix drawBarcode(stream);&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/430728/431866/re-a-simle-way-to-generate-datamatrix-barcode-using-c/#431866</guid>
      <pubDate>Wed, 10 Apr 2013 20:40:21 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>How to add values to checkedlistbox from database</title>
      <link>http://www.programmersheaven.com/mb/csharp/431855/431855/how-to-add-values-to-checkedlistbox-from-database/</link>
      <description>I want to display database value in checkedlistbox for windows application form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to do this ?&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431855/431855/how-to-add-values-to-checkedlistbox-from-database/</guid>
      <pubDate>Tue, 09 Apr 2013 13:26:22 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>String.Split - How to calculate slot</title>
      <link>http://www.programmersheaven.com/mb/csharp/431780/431780/stringsplit---how-to-calculate-slot/</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
look im new in programming, would be awesome if u could help me.&lt;br /&gt;
&lt;br /&gt;
Im reading a whole .csv File with this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;private void button3_Click(object sender, EventArgs e)
        {
            {
                var content = string.Empty;
                using (StreamReader reader = new StreamReader(@"C:/1.csv", System.Text.Encoding.Default))
                {
                    content = reader.ReadToEnd();
                    reader.Close();
                }

                content = content.Replace("\"", string.Empty);
                content = content.Replace("               ", "");
               content = content.Replace("             ", "");

                using (StreamWriter writer = new StreamWriter(@"C:/2.csv"))
                {
                    writer.Write(content);
                    writer.Close();
                }
            }
        }&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.CSV Input looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
" 09000";"Catalaog 1";10148;234&lt;br /&gt;
" 09001";"Catalaog 2";0;345&lt;br /&gt;
&lt;br /&gt;
2.CSV Outlooks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
09000~Catalaog 1~10148~234&lt;br /&gt;
09001~Catalaog 2~0~0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I need a rewrite of my Code that the last delimited Columns 10148~234 get calculated.&lt;br /&gt;
&lt;br /&gt;
String must look like this at the end:&lt;br /&gt;
&lt;br /&gt;
09000~Catalaog 1~9914~234&lt;br /&gt;
09001~Catalaog 2~0~0&lt;br /&gt;
&lt;br /&gt;
See the diffrence? The 10148 - 234 = 9914. The 10148 gets replaced with the result.&lt;br /&gt;
&lt;br /&gt;
Could u rewrite my upper code and help me ?:&amp;lt; &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431780/431780/stringsplit---how-to-calculate-slot/</guid>
      <pubDate>Thu, 04 Apr 2013 03:49:28 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Error on randomizing strings in a list C#</title>
      <link>http://www.programmersheaven.com/mb/csharp/431744/431744/error-on-randomizing-strings-in-a-list-c/</link>
      <description>I want to create a program that shows a random category (from the list of category I've created) with the right words in a message box whenever I click the button.&lt;br /&gt;
&lt;img src="http://i717.photobucket.com/albums/ww176/T3ZTAM3NT/1stSSonError_zpsb1007b5d.jpg" /&gt;&lt;br /&gt;
The categories is randomized when I run it but the right word that should be with the category isn't correctly placed.&lt;br /&gt;
&lt;img src="http://i717.photobucket.com/albums/ww176/T3ZTAM3NT/2ndSSonError_zps1a838970.jpg" /&gt;&lt;br /&gt;
Also, I know that the program will crash once the program reaches a negative index of a category or once all of the category is shown.&lt;br /&gt;
&lt;br /&gt;
Code:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;namespace randomCategory
{
    public partial class Form1 : Form
    {

        Random rand = new Random();
        List&amp;lt;string&amp;gt; categories = new List&amp;lt;string&amp;gt; { "Book Titles", "Movie Titles", "Car Parts", "Human Body Parts", "Transportations" };
        

        public Form1()
        {
            InitializeComponent();
            listBox1.DataSource = categories;
        }

        public void selection()
        {
            // logic for setting a random category
            int index = rand.Next(categories.Count);
            var category = categories[index];
            
            
            // logic for assigning the word for a category
            switch (index)
            {
                case 0:
                    MessageBox.Show(category, "Harry Potter");
                    break;
                case 1:
                    MessageBox.Show(category, "Summer Wars");
                    break;
                case 2:
                    MessageBox.Show(category, "Bumper");
                    break;
                case 3:
                    MessageBox.Show(category, "Eyes");
                    break;
                case 4:
                    MessageBox.Show(category, "Boat");
                    break;
                default:
                    MessageBox.Show("Empty!", "!!!");
                    break;
            }

            categories.RemoveAt(index);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            selection();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431744/431744/error-on-randomizing-strings-in-a-list-c/</guid>
      <pubDate>Fri, 29 Mar 2013 10:50:17 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>How to prevent deleting a file from usb flash disk</title>
      <link>http://www.programmersheaven.com/mb/csharp/431677/431677/how-to-prevent-deleting-a-file-from-usb-flash-disk/</link>
      <description>hi every body&lt;br /&gt;
&lt;br /&gt;
I want to find a way to prevent deleting a file(exe) from usb flash disk&lt;br /&gt;
&lt;br /&gt;
And the problem is that i want to write a program that place in usb flash disk, and when yhe flash is connected to computer then the program is run.&lt;br /&gt;
&lt;br /&gt;
and user can not close and delete it.&lt;br /&gt;
&lt;br /&gt;
how can i do that?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431677/431677/how-to-prevent-deleting-a-file-from-usb-flash-disk/</guid>
      <pubDate>Sun, 24 Mar 2013 03:56:26 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Design client in C#</title>
      <link>http://www.programmersheaven.com/mb/csharp/431651/431651/design-client-in-c/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I have to design a client for a web service. But the web service can only takes 10 concurrent request (as it has only 10 concurrent licences). So if I fire 1000 client at time the 950 request are rejected.&lt;br /&gt;
&lt;br /&gt;
Each time client will login with different user name and password. How to efficiently design a client so that no request is rejected. (it is okay if client waits for the connection)   &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431651/431651/design-client-in-c/</guid>
      <pubDate>Fri, 22 Mar 2013 04:40:22 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Model - View - Presenter in Windows Presentation Foundation</title>
      <link>http://www.programmersheaven.com/mb/csharp/431641/431641/model---view---presenter-in-windows-presentation-foundation/</link>
      <description>Hello, does anyone could help me to work with mvp (Model - View - Presenter) in wpf (Windows Presentation Foundation)?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431641/431641/model---view---presenter-in-windows-presentation-foundation/</guid>
      <pubDate>Wed, 20 Mar 2013 09:03:37 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Model - View - Presenter in Windows Presentation Foundation</title>
      <link>http://www.programmersheaven.com/mb/csharp/431640/431640/model---view---presenter-in-windows-presentation-foundation/</link>
      <description>Hello, does anyone could help me to work with mvp (Model - View - Presenter) in wpf (Windows Presentation Foundation)?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431640/431640/model---view---presenter-in-windows-presentation-foundation/</guid>
      <pubDate>Wed, 20 Mar 2013 09:01:47 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>INT based array to display as graphic tiles ...</title>
      <link>http://www.programmersheaven.com/mb/csharp/431621/431621/int-based-array-to-display-as-graphic-tiles-/</link>
      <description>hi, trying to recreate a simple top down view zelda type game in C# I had made in VB6 i had created years and years ago, and then again in Javascript like 2 years ago.. &lt;br /&gt;
so far all i have is 2 bmps 1 = floor2.bmp&lt;br /&gt;
                            2 = wall2.bmp&lt;br /&gt;
                     1 button&lt;br /&gt;
                     1 function called updateDisplay()&lt;br /&gt;
&lt;br /&gt;
here i have a simple room array...&lt;br /&gt;
&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
&lt;strong&gt;        int C=1;&lt;br /&gt;
&lt;/strong&gt;        //---ROOM 1----------------------&lt;br /&gt;
&lt;strong&gt;        int[,] Room1 = {&lt;br /&gt;
&lt;/strong&gt; {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
followed by a simple function for a button to display the room&lt;br /&gt;
       private void updateDisplay(int r)&lt;br /&gt;
        {&lt;br /&gt;
            for (int X = 0; X &amp;lt; 20; X++)&lt;br /&gt;
            {&lt;br /&gt;
                for (int Y = 0; Y &amp;lt; 15; Y++)&lt;br /&gt;
                {&lt;br /&gt;
                    //---------------------------------------------ROOM 1--------&lt;br /&gt;
                    if (r == 1)&lt;br /&gt;
                    {&lt;br /&gt;
                        if (Room1[Y, X] == 1) //wall&lt;br /&gt;
                        {&lt;br /&gt;
                            PictureBox p = new PictureBox();&lt;br /&gt;
                            p.BackColor = Color.Black;&lt;br /&gt;
                            p.Image = Properties.Resources.wall2;&lt;br /&gt;
                            p.Location = new Point(X * 32, Y * 32);&lt;br /&gt;
                            p.Size = new Size(32, 32);&lt;br /&gt;
                            panel1.Controls.Add(p);&lt;br /&gt;
                        }&lt;br /&gt;
                        if (Room1[Y, X] == 0) //floor&lt;br /&gt;
                        {&lt;br /&gt;
                            PictureBox p = new PictureBox();&lt;br /&gt;
                            p.BackColor = Color.White;&lt;br /&gt;
                            p.Image = Properties.Resources.floor2;&lt;br /&gt;
                            p.Location = new Point(X * 32, Y * 32);&lt;br /&gt;
                            p.Size = new Size(32, 32);&lt;br /&gt;
                            panel1.Controls.Add(p);&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
and then the button:&lt;br /&gt;
        private void btnCreate_Click(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            panel1.Size = new Size(32 * 20, 32 * 15); &lt;br /&gt;
            updateDisplay(C);&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
( i know ill be able to detect walls and such for movement purposes later with the room array )&lt;br /&gt;
but right now its in a PANEL and i caint seem to update that panel ..id much rather it draws in the form itself but caint seem to understand how that all works..&lt;br /&gt;
ive already learned the key inputs from a previous program/game i have made in C#(sort of like a space exploration vessel)&lt;br /&gt;
but &lt;span style="color: Blue;"&gt;would appreciate any help anyone can offer to get me started with TILES in C#..&lt;/span&gt;&lt;br /&gt;
seems like everywhere i have posted for assistance I eighter get treated ignorantly or "just google C#games making" witch of course brings me to XNA links, but id like to learn more C# first...&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=2574"&gt;tileAdventure.rar&lt;/a&gt; (75202 bytes | downloaded 21 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431621/431621/int-based-array-to-display-as-graphic-tiles-/</guid>
      <pubDate>Mon, 18 Mar 2013 16:53:29 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>INT based array to display as graphic tiles ...</title>
      <link>http://www.programmersheaven.com/mb/csharp/431620/431620/int-based-array-to-display-as-graphic-tiles-/</link>
      <description>hi, trying to recreate a simple top down view zelda type game in C# I had made in VB6 i had created years and years ago, and then again in Javascript like 2 years ago.. &lt;br /&gt;
so far all i have is 2 bmps 1 = floor2.bmp&lt;br /&gt;
                            2 = wall2.bmp&lt;br /&gt;
                     1 button&lt;br /&gt;
                     1 function called updateDisplay()&lt;br /&gt;
&lt;br /&gt;
here i have a simple room array...&lt;br /&gt;
&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
&lt;strong&gt;        int C=1;&lt;br /&gt;
&lt;/strong&gt;        //---ROOM 1----------------------&lt;br /&gt;
&lt;strong&gt;        int[,] Room1 = {&lt;br /&gt;
&lt;/strong&gt; {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},&lt;br /&gt;
 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
followed by a simple function for a button to display the room&lt;br /&gt;
       private void updateDisplay(int r)&lt;br /&gt;
        {&lt;br /&gt;
            for (int X = 0; X &amp;lt; 20; X++)&lt;br /&gt;
            {&lt;br /&gt;
                for (int Y = 0; Y &amp;lt; 15; Y++)&lt;br /&gt;
                {&lt;br /&gt;
                    //---------------------------------------------ROOM 1--------&lt;br /&gt;
                    if (r == 1)&lt;br /&gt;
                    {&lt;br /&gt;
                        if (Room1[Y, X] == 1) //wall&lt;br /&gt;
                        {&lt;br /&gt;
                            PictureBox p = new PictureBox();&lt;br /&gt;
                            p.BackColor = Color.Black;&lt;br /&gt;
                            p.Image = Properties.Resources.wall2;&lt;br /&gt;
                            p.Location = new Point(X * 32, Y * 32);&lt;br /&gt;
                            p.Size = new Size(32, 32);&lt;br /&gt;
                            panel1.Controls.Add(p);&lt;br /&gt;
                        }&lt;br /&gt;
                        if (Room1[Y, X] == 0) //floor&lt;br /&gt;
                        {&lt;br /&gt;
                            PictureBox p = new PictureBox();&lt;br /&gt;
                            p.BackColor = Color.White;&lt;br /&gt;
                            p.Image = Properties.Resources.floor2;&lt;br /&gt;
                            p.Location = new Point(X * 32, Y * 32);&lt;br /&gt;
                            p.Size = new Size(32, 32);&lt;br /&gt;
                            panel1.Controls.Add(p);&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
and then the button:&lt;br /&gt;
        private void btnCreate_Click(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            panel1.Size = new Size(32 * 20, 32 * 15); &lt;br /&gt;
            updateDisplay(C);&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
( i know ill be able to detect walls and such for movement purposes later with the room array )&lt;br /&gt;
but right now its in a PANEL and i caint seem to update that panel ..id much rather it draws in the form itself but caint seem to understand how that all works..&lt;br /&gt;
ive already learned the key inputs from a previous program/game i have made in C#(sort of like a space exploration vessel)&lt;br /&gt;
but &lt;span style="color: Blue;"&gt;would appreciate any help anyone can offer to get me started with TILES in C#..&lt;/span&gt;&lt;br /&gt;
seems like everywhere i have posted for assistance I eighter get treated ignorantly or "just google C#games making" witch of course brings me to XNA links, but id like to learn more C# first...&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=2573"&gt;tileAdventure.rar&lt;/a&gt; (75202 bytes | downloaded 31 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431620/431620/int-based-array-to-display-as-graphic-tiles-/</guid>
      <pubDate>Mon, 18 Mar 2013 16:49:38 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: BIGINNER NEED HELP!!!!!!!</title>
      <link>http://www.programmersheaven.com/mb/csharp/431220/431613/re-biginner-need-help/#431613</link>
      <description>Hi,,&lt;br /&gt;
I did it different way thanks for your interest and help.&lt;br /&gt;
Take Care&lt;br /&gt;
Have A Nice Day&lt;br /&gt;
If I have any more question I will post and waiting for your Reply.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431220/431613/re-biginner-need-help/#431613</guid>
      <pubDate>Mon, 18 Mar 2013 07:29:46 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: How to avoids search words</title>
      <link>http://www.programmersheaven.com/mb/csharp/431329/431612/re-how-to-avoids-search-words/#431612</link>
      <description>Hi,,&lt;br /&gt;
I did it different way thanks for your interest and help.&lt;br /&gt;
Take Care&lt;br /&gt;
Have A Nice Day&lt;br /&gt;
If I have any more question I will post and waiting for your Reply.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431329/431612/re-how-to-avoids-search-words/#431612</guid>
      <pubDate>Mon, 18 Mar 2013 07:24:28 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: How to avoids search words</title>
      <link>http://www.programmersheaven.com/mb/csharp/431329/431610/re-how-to-avoids-search-words/#431610</link>
      <description>I finished this project!!!, &lt;br /&gt;
I did it totally different way thanks for interest an help&lt;br /&gt;
Take Care&lt;br /&gt;
Have a good Day!!!.&lt;br /&gt;
If i have any more question I will post and waiting for your reply!!!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431329/431610/re-how-to-avoids-search-words/#431610</guid>
      <pubDate>Mon, 18 Mar 2013 07:14:21 -0700</pubDate>
      <category>C#</category>
    </item>
  </channel>
</rss>