• Gah. you'll want this in the first for loop:

    foreach (DataRow t in ...) {

    sql.Clear();

    ...