You wrote:
if (tableTags.Rows[k]["Tags"].ToString().Equals(result.Rows[j]["TagName"].ToString()))
It should be:
if (tableTags.Rows[k]["TagName"].ToString().Equals(result.Rows[j]["Tags"].ToString()))
You named the column of
result
variable "Tags"; I supposed you just switched their names. Why not giving them the same name?
Another possible solution is to put a breakpoint on the first line and launch the solution in debug mode. Then see line by line what the variables you declare actually contain.