Remove current datarow and update previous datarow at a time from datatable
<p>using (dsBooking = objCust.SelectAll_BookingHall())            </p>

<pre><code>                for (int i = 0; i &lt; dsBooking.Tables[0].Rows.Count; i++)
                {   
                    if (i == 0)
                    {
                        DataColumn dc1 = new DataColumn();
                        dc1.DataType = typeof(string);
                        dc1.ColumnName = "Hall_Name";

                        DataColumn dc2 = new DataColumn();
                        dc2.DataType = typeof(string);
                        dc2.ColumnName = "Hall_Capacity";

                        DataColumn dc3 = new DataColumn();
                        dc3.DataType = typeof(string);
                        dc3.ColumnName = "Amount";

                        DataColumn dc4 = new DataColumn();
                        dc4.DataType = typeof(string);
                        dc4.ColumnName = "Status";

                        DataColumn dc5 = new DataColumn();
                        dc5.DataType = typeof(string);
                        dc5.ColumnName = "Morning";

                        DataColumn dc6 = new DataColumn();
                        dc6.DataType = typeof(string);
                        dc6.ColumnName = "Evening";

                        DataColumn dc7 = new DataColumn();
                        dc7.DataType = typeof(string);
                        dc7.ColumnName = "Date";

                        dtb.Columns.Add(dc1);
                        dtb.Columns.Add(dc2);
                        dtb.Columns.Add(dc3);
                        dtb.Columns.Add(dc4);
                        dtb.Columns.Add(dc5);
                        dtb.Columns.Add(dc6);
                        dtb.Columns.Add(dc7);
                    }


                    dr[i] = dtb.NewRow();
                    dr[i]["Hall_Name"] = dsBooking.Tables[0].Rows[i]["Hall_Name"].ToString();
                    dr[i]["Amount"] = dsBooking.Tables[0].Rows[i]["Hall_Amt"].ToString();
                    dr[i]["Hall_Capacity"] = dsBooking.Tables[0].Rows[i]["Hall_Capacity"].ToString();

                    dr[i]["Morning"] = dsBooking.Tables[0].Rows[i]["Morning"].ToString();
                    dr[i]["Evening"] = dsBooking.Tables[0].Rows[i]["Evening"].ToString();
                    dr[i]["Date"] = dsBooking.Tables[0].Rows[i]["Date"].ToString(); 
                    dtb.Rows.Add(dr[i]);
                }
</code></pre>

<p>// Note :- Here I got data from dtb but i want to distict this data and go to process ahead........</p>

<pre><code>            for (int i = 0; i &lt; dtb.Rows.Count; i++)
            {

                var distinct = dtb.AsEnumerable().Distinct(DataRowComparer.Default);                       


                string aa = dtb.Rows[i]["Morning"].ToString();
                string b = dtb.Rows[i]["Evening"].ToString();



                if (dtb.Rows[i]["Morning"] == "" &amp;&amp; dtb.Rows[i]["Evening"] == "")
                {

                    dtb.Rows[i]["Hall_Name"] = dsBooking.Tables[0].Rows[i]["Hall_Name"].ToString();
                    dtb.Rows[i]["Hall_Capacity"] = dsBooking.Tables[0].Rows[i]["Hall_Capacity"].ToString();
                    dtb.Rows[i]["Status"] = lbl_Available.Text;
                    dtb.Rows[i]["Amount"] = dsBooking.Tables[0].Rows[i]["Hall_Amt"].ToString();
                    dtb.Rows[i]["Morning"] = "Avail";
                    dtb.Rows[i]["Evening"] = "Avail";

                }





                if (aa == "Yes" &amp;&amp; b == "Yes")
                {
                    dtb.Rows[i]["Hall_Name"] = dsBooking.Tables[0].Rows[i]["Hall_Name"].ToString();
                    dtb.Rows[i]["Hall_Capacity"] = dsBooking.Tables[0].Rows[i]["Hall_Capacity"].ToString();
                    dtb.Rows[i]["Status"] = lbl_Booked.Text;
                    dtb.Rows[i]["Amount"] = dsBooking.Tables[0].Rows[i]["Hall_Amt"].ToString();
                    dtb.Rows[i]["Morning"] = dsBooking.Tables[0].Rows[i]["Morning"].ToString();
                    dtb.Rows[i]["Evening"] = dsBooking.Tables[0].Rows[i]["Evening"].ToString();

                }


                if (aa == "Yes" &amp;&amp; b == "No" || aa == "No" &amp;&amp; b == "Yes")
                {

                    if (aa == "Yes" &amp;&amp; b == "No")
                    {
                        dtb.Rows[i]["Hall_Name"] = dsBooking.Tables[0].Rows[i]["Hall_Name"].ToString();
                        dtb.Rows[i]["Hall_Capacity"] = dsBooking.Tables[0].Rows[i]["Hall_Capacity"].ToString();
                        dtb.Rows[i]["Status"] = "Avail/Booked";
                        dtb.Rows[i]["Amount"] = dsBooking.Tables[0].Rows[i]["Hall_Amt"].ToString();
                        dtb.Rows[i]["Morning"] = dsBooking.Tables[0].Rows[i]["Morning"].ToString();
                        dtb.Rows[i]["Evening"] = dsBooking.Tables[0].Rows[i]["Evening"].ToString();

                        lblhname.Text = dsBooking.Tables[0].Rows[i]["Hall_Name"].ToString();

                    }

                    if (aa == "No" &amp;&amp; b == "Yes")
                    {
</code></pre>

<p>// Note :- Onces My condition come here i must update previour data row which is in aa == "Yes" &amp;&amp; b == "No"</p>

<pre><code>                        if (lblhname.Text == dsBooking.Tables[0].Rows[i]["Hall_Name"].ToString())
                        {

                            var distt = dtb.AsEnumerable().Distinct(DataRowComparer.Default);                       



                        }
                    }

                }











            }
            Hall_BookingDetails.DataSource = dtb;
            Hall_BookingDetails.DataBind();
</code></pre>
