Merge two DataTables by adding corresponding entries I've been looking over internet for a method of combining 2 datatables with exactly the same cells with numbers to add them together, Merge method never help because it just appended the second table. The task was later accomplished by my hand-written method:

static DataTable CombineDT34(DataTable dt3, DataTable dt4) {
        var combinedDT34 = dt3;
        for (var r3 = 0; r3 &lt; dt3.Rows.Count; r3++) {

            for(var c3 = 1; c3 &lt; dt3.Columns.Count; c3++) {

                dt3.Rows[r3][c3] = 
                    (Convert.ToInt32(dt3.Rows[r3][c3]) +
                    Convert.ToInt32(dt4.Rows[r3][c3]));
            }
        }

        return dt3;
    }


Is there are a way to do this better?
You are not testing for same size.

You don't use combinedDT34.  You are changing an input which is not a good practice.  I am not sure if dt3 will be passed by reference.

You are starting column on 1.   

static DataTable CombineDT34(DataTable dt3, DataTable dt4) 
{
    if(dt3.Rows.Count != dt4.Rows.Count)
        throw new ArgumentOutOfRangeException);
    //...

    for (var r3 = 0; r3 &lt; dt3.Rows.Count; r3++) 
    {
        for(var c3 = 0; c3 &lt; dt3.Columns.Count; c3++) 
        {
            dt3.Rows[r3][c3] = ( Convert.ToInt32(dt3.Rows[r3][c3]) +
                                 Convert.ToInt32(dt4.Rows[r3][c3]) );
        }
    }
    return dt3;
}