using DataTable.Merge method instead of for loop to update database
added template