<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>AzamSharp</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/AzamSharp/Atom.aspx" />
    <subtitle type="html">Some day I will know everything. I hope that day never comes.</subtitle>
    <id>http://geekswithblogs.net/AzamSharp/Default.aspx</id>
    <author>
        <name>Mohammad Azam</name>
        <uri>http://geekswithblogs.net/AzamSharp/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2008-08-07T15:47:17Z</updated>
    <entry>
        <title>Unveiling www.ScreencastADay.com </title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/08/07/124308.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/08/07/124308.aspx</id>
        <published>2008-08-07T15:47:17-12:00:00</published>
        <updated>2008-08-07T15:47:17Z</updated>
        <content type="html">&lt;span style="text-decoration: underline; font-family: Arial,Helvetica,sans-serif; font-size: small; font-weight: bold;"&gt;What is ScreencastADay?&lt;/span&gt;&lt;br style="text-decoration: underline; font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small;"&gt;Welcome to www.ScreencastADay.com, a website committed to educate you everyday. The idea of the website is really simple. We believe that in order to be successful you need to learn something new everyday. ScreencastADay puts this thought into action by providing new screencast every day. This means you will get 7 screencasts a week and 365 screencasts a year unless of course it is a leap year in that case you get one more bonus screencast.&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small;"&gt;     &lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;Is this website completely free?&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;br style="text-decoration: underline;" /&gt;
&lt;/strong&gt;     &lt;br /&gt;
Yes! Currently, there is no registration fee associated with the website.&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small;"&gt;     &lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;How can I request a Screencast?&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;br style="text-decoration: underline;" /&gt;
&lt;/strong&gt;     &lt;br /&gt;
You can request a website using the &lt;a href="http://groups.google.com/group/screencastaday"&gt;ScreenCastADay Google Group &lt;/a&gt;. &lt;/span&gt;     &lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small; font-weight: bold; text-decoration: underline;"&gt;Are there any exceptions?&lt;/span&gt;&lt;strong&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small; text-decoration: underline;" /&gt;
&lt;/strong&gt;     &lt;br style="font-family: Arial,Helvetica,sans-serif; font-size: small;" /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small;"&gt;     Although we don’t like to make any exceptions to this rule but life is uncertain      and can take unexpected turns. All we can say is that we will try our best to      work around your wishes and provide screencast every day.     &lt;/span&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/124308.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Subscribe to my feeds</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/07/10/123728.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/07/10/123728.aspx</id>
        <published>2008-07-10T14:57:22-12:00:00</published>
        <updated>2008-07-10T14:57:22Z</updated>
        <content type="html">Hi you can subscribe to my feeds using the link below: &lt;br /&gt;
&lt;br /&gt;
http://feeds.feedburner.com/Azamsharp&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Azam&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/123728.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Hulk Up Your BulkCopy Operations Using SqlBulkCopy Class</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/06/25/123376.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/06/25/123376.aspx</id>
        <published>2008-06-25T14:13:11-12:00:00</published>
        <updated>2008-06-25T14:13:11Z</updated>
        <content type="html">&lt;br /&gt;
&lt;a href="http://azamsharp.com/Posts/54_HULK_UP_Your_Bulk_Copy_Operations_Using_SqlBulkCopy.aspx"&gt;Hulk Up Your BulkCopy Operations Using SqlBulkCopy Class&lt;/a&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/123376.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Please help this young man!!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/06/24/123152.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/06/24/123152.aspx</id>
        <published>2008-06-24T17:17:21-12:00:00</published>
        <updated>2008-06-24T17:17:21Z</updated>
        <content type="html">&lt;br /&gt;
&lt;a href="http://dbalink.wordpress.com/2008/06/24/i-need-help-to-save-my-dying-mother/"&gt;http://dbalink.wordpress.com/2008/06/24/i-need-help-to-save-my-dying-mother/&lt;/a&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/123152.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>My Weekend Adventure with Sony Book Reader</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/06/24/123148.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/06/24/123148.aspx</id>
        <published>2008-06-24T13:54:00-12:00:00</published>
        <updated>2008-06-24T13:54:00Z</updated>
        <content type="html">&lt;br /&gt;
&lt;a href="http://azamsharp.com/Posts/49_My_Weekend_Adventure_with_Sony_Book_Reader_PRS_505.aspx"&gt;My Weekend Adventure with Sony Book Reader&lt;/a&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/123148.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Do you Refactor Code?</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/06/06/122685.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/06/06/122685.aspx</id>
        <published>2008-06-06T15:05:37-12:00:00</published>
        <updated>2008-06-06T15:05:37Z</updated>
        <content type="html">Check out the following url: 

&lt;a href="http://azamsharp.com/Posts/37_Do_you_Refactor_Code_.aspx"&gt;Do you Refactor Code? &lt;/a&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/122685.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Future of .NET As I See IT!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/06/04/122613.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/06/04/122613.aspx</id>
        <published>2008-06-04T01:43:04-12:00:00</published>
        <updated>2008-06-04T01:43:04Z</updated>
        <content type="html">Check out the  post on my new blog: 

&lt;a href="http://azamsharp.com/Posts/29_Future_of__NET.aspx"&gt; Future of .NET &lt;/a&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/122613.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>So long GeeksWithBlogs!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/05/27/122419.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/05/27/122419.aspx</id>
        <published>2008-05-27T07:06:49-12:00:00</published>
        <updated>2008-05-27T07:06:49Z</updated>
        <content type="html">&lt;p&gt;I have blogged on GeeksWithBlogs for a long time and I have enjoyed every second of it. For the past couple of days I have been working on my own blog and today it has been launched. I will be blogged at &lt;a href="http://www.azamsharp.com"&gt;www.azamsharp.com&lt;/a&gt;. I will miss GeeksWithBlogs and I thank everyone for creating such a wonderful blogging community. &lt;/p&gt; &lt;p&gt;As of today (May 27 2008) this blog is officially closed. &lt;/p&gt; &lt;p&gt;Please update your links to &lt;a href="http://www.azamsharp.com"&gt;www.azamsharp.com&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;Thanks,&lt;/p&gt; &lt;p&gt;AzamSharp &lt;/p&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/122419.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Article Published: Only Updating the Changed Rows in GridView Control</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/05/25/122382.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/05/25/122382.aspx</id>
        <published>2008-05-25T10:23:22-12:00:00</published>
        <updated>2008-05-25T10:23:22Z</updated>
        <content type="html">&lt;p&gt;&lt;span id="ctl00_cphCell1_datalistArticles_ctl01_lblArticleDescription"&gt;&lt;a href="http://mattberseth.com/"&gt;&lt;font face="Arial" color="#0000ff" size="2"&gt;Matt Berseth&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt; wrote a very interesting article on “&lt;/font&gt;&lt;a href="http://mattberseth.com/blog/2008/05/bulk_inserting_data_with_the_l.html"&gt;&lt;font face="Arial" color="#0000ff" size="2"&gt;Bulk Inserting Data Using the ListView Control&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt;". The idea is to give the user an Excel like interface where they can edit the rows with custom data and finally click the update button to persist the data in the database. Matt’s solution was great but lacks a very important detail. There was no way to know what rows were changed by the user. Matt took the road to update all the rows whether they were changed or not. In this article we are going to take a look at an alternative method of updating only the changed rows.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;&lt;font face="Arial" size="2"&gt;&lt;a href="http://www.gridviewguy.com/Articles/408_Updating_Only_Changed_Rows_in_the_GridView_Control.aspx"&gt;Updating Only Changed Rows in the GridView Control&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/122382.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Updating Only Changed Rows Using GridView Control</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/AzamSharp/archive/2008/05/22/122322.aspx" />
        <id>http://geekswithblogs.net/AzamSharp/archive/2008/05/22/122322.aspx</id>
        <published>2008-05-22T11:40:48-12:00:00</published>
        <updated>2008-05-22T11:40:48Z</updated>
        <content type="html">&lt;p&gt;&lt;/p&gt; &lt;p&gt;Mark Berseth wrote a very interested article about &lt;a href="http://mattberseth.com/blog/2008/05/bulk_inserting_data_with_the_l.html"&gt;Bulk Insert Data Using ListView Control&lt;/a&gt;. Basically, the ListView control is displayed with the TextBox controls in each row (like MS Excel). Now, the user can write in the TextBox and then use the submit button to insert all the new rows to the database. This works well when you are inserting the data into the database. The problem starts when you try to update the data which is already in the database. Let's say you populate the ListView with some data and now you want to edit it. You will change only one row and press the submit button. The ListView control does not know which row has been changed and hence you will have to send all the rows back to the database even though only a single row got changed. &lt;/p&gt; &lt;p&gt;There should be some way to only update the changed row. In this post I am going to discuss a simple technique that solves this problem. Let's start by populating the GridView control (You can use ListView if you prefer). &lt;/p&gt; &lt;p&gt; private void BindData()&lt;br /&gt;        {&lt;br /&gt;            string connectionString = "Server=localhost;Database=Northwind;Trusted_Connection=true";&lt;br /&gt;            SqlConnection conn = new SqlConnection(connectionString);&lt;br /&gt;            SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM Categories", conn);&lt;/p&gt; &lt;p&gt;            DataSet ds = new DataSet();&lt;br /&gt;            ad.Fill(ds);&lt;/p&gt; &lt;p&gt;            gvCategories.DataSource = ds;&lt;br /&gt;            gvCategories.DataBind();&lt;br /&gt;        }&lt;/p&gt; &lt;p&gt;And here is the HTML view of the GridView control. &lt;/p&gt; &lt;p&gt;&amp;lt;asp:GridView ID="gvCategories" runat="server" DataKeyNames="id" AutoGenerateColumns="false" &lt;br /&gt;            &amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;Columns&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;asp:TemplateField HeaderText="CategoryID"&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;    &amp;lt;%# Eval("id") %&amp;gt;&lt;br /&gt;    &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;    &lt;br /&gt;       &amp;lt;asp:TemplateField HeaderText="CategoryName"&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;    &amp;lt;asp:TextBox ID="txtCategoryName" &lt;strong&gt;onchange='&amp;lt;%# AttachFunction(Container.DataItemIndex) %&amp;gt;'&lt;/strong&gt; runat="server" Text='&amp;lt;%# Eval("CategoryName") %&amp;gt;' /&amp;gt;&lt;br /&gt;    &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;asp:TemplateField HeaderText="Description"&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;    &amp;lt;asp:TextBox ID="txtCategoryDescription" &lt;strong&gt;onchange='&amp;lt;%# AttachFunction(Container.DataItemIndex) %&amp;gt;'&lt;/strong&gt; runat="server" Text='&amp;lt;%# Eval("Description") %&amp;gt;' /&amp;gt;&lt;br /&gt;    &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/Columns&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/asp:GridView&amp;gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;I am attaching the onchange JavaScript function to the TextBoxes. The onchange event will be fired whenever the text inside the TextBox will change. I am also passing the current RowIndex of the GridView row. This will keep track which row has been changed. Now, let's check out the AttachFunction which is a server side function.&lt;/p&gt; &lt;p&gt; protected string &lt;strong&gt;AttachFunction&lt;/strong&gt;(int rowIndex)&lt;br /&gt;        {&lt;br /&gt;            string function = "saveRowIndex(";&lt;/p&gt; &lt;p&gt;            return function + rowIndex + ")"; &lt;br /&gt;        }&lt;/p&gt; &lt;p&gt;function saveRowIndex(rowIndex) &lt;br /&gt;{&lt;br /&gt;    AjaxWithJQuery.SimpleService.NoteChangedRows(rowIndex);    &lt;br /&gt;}&lt;/p&gt; &lt;p&gt;In the above code I am firing an Ajax method named NoteChangedRows. &lt;/p&gt; &lt;p&gt;[WebMethod(true)]&lt;br /&gt;        public void NoteChangedRows(int rowIndex)&lt;br /&gt;        {&lt;br /&gt;            List&amp;lt;Int32&amp;gt; list = null;&lt;/p&gt; &lt;p&gt;            if (Session["List"] == null)&lt;br /&gt;            {&lt;br /&gt;                list = new List&amp;lt;int&amp;gt;();&lt;/p&gt; &lt;p&gt;                if (list.Contains(rowIndex)) return;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;                list.Add(rowIndex);&lt;br /&gt;                Session["List"] = list; &lt;br /&gt;            }&lt;/p&gt; &lt;p&gt;            else&lt;br /&gt;            {&lt;br /&gt;                list = Session["List"] as List&amp;lt;Int32&amp;gt;;&lt;/p&gt; &lt;p&gt;                if (list.Contains(rowIndex)) return;&lt;/p&gt; &lt;p&gt;                list.Add(rowIndex); &lt;br /&gt;            }&lt;/p&gt; &lt;p&gt;            &lt;br /&gt;        }&lt;/p&gt; &lt;p&gt;NoteChangedRows simply stores the row index of the rows that have been changed. Now, let's see the Update method which is fired when the user clicks the update button.&lt;/p&gt; &lt;p&gt;        protected void Update(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            // get only the changed rows and not all the rows &lt;br /&gt;            List&amp;lt;Int32&amp;gt; list = Session["List"] as List&amp;lt;Int32&amp;gt;; &lt;/p&gt; &lt;p&gt;           &lt;br /&gt;            for (int i = 0; i &amp;lt; list.Count; i++)&lt;br /&gt;            {&lt;br /&gt;                GridViewRow row = gvCategories.Rows[list[i]];&lt;/p&gt; &lt;p&gt;&lt;br /&gt;                int id = (int) gvCategories.DataKeys[list[i]].Value;&lt;br /&gt;                string categoryName = (row.FindControl("txtCategoryName") as TextBox).Text;&lt;br /&gt;                string categoryDescription = (row.FindControl("txtCategoryDescription") as TextBox).Text;&lt;/p&gt; &lt;p&gt;                // DO THE ACTUAL UPDATE HERE!&lt;/p&gt; &lt;p&gt;                lblFinal.Text += id + "&amp;lt;BR&amp;gt;" + categoryName + "&amp;lt;BR&amp;gt;" + categoryDescription;&lt;br /&gt;            }&lt;/p&gt; &lt;p&gt;            // reset the list! &lt;br /&gt;            Session["List"] = null;&lt;br /&gt;            &lt;/p&gt; &lt;p&gt;        }&lt;/p&gt; &lt;p&gt;The update method simply looks into the RowIndex list and finds the changed rows from that list. Now, we only have to update those changed rows and not all the rows. &lt;/p&gt; &lt;p&gt;I will write an article on this technique and publish it on &lt;a href="http://www.gridviewguy.com/"&gt;GridViewGuy&lt;/a&gt;. So, stay tunned! &lt;/p&gt;&lt;img src="http://geekswithblogs.net/AzamSharp/aggbug/122322.aspx" width="1" height="1" /&gt;</content>
    </entry>
</feed>