This happens when we call WriteXml method of DataTable:
This exception is raised when we serializes a DataTable when its TableName Property is not set. So, to stop getting this error you have to ensure that the DataTable have TableName property set.
NOTE: This do not worth if you are using XMLDataDocument. But remember, XMLDataDocument marked obsolete in framework 4.0 or later and compiler generates warning.