//
You're reading...
Tips/Tricks

Error: Cannot serialize the DataTable. DataTable name is not set

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.

Advertisements

About Shahan Ayyub

Shahan is a Microsoft Certified Professional of .Net. Mostly self taught programmer and a quick learner, who just love to code and always eager to find unique solutions to the common problems. Currently working as an iOS developer.

Discussion

2 thoughts on “Error: Cannot serialize the DataTable. DataTable name is not set

  1. Type DataTable Name …your error will be solved
    e.g.,
    dt.TableName = “Doctor”;

    Posted by Yogesh | September 23, 2014, 12:26 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: