I have a WCF service from which I want to return a DataTable. I know that this is often a highly-debated topic, as far as whether or not returning DataTables is a good pract
For anyone having similar problems, I have solved my issue. It was several-fold.
For a DataTable to be serializable, it needs to be given a name. The default constructor does not give the table a name, so:
return new DataTable();
will not be serializable, while:
return new DataTable("someName");
will name the table whatever is passed as the parameter.
Note that a table can be given a name at any time by assigning a string to the TableName property of the DataTable.
var table = new DataTable();
table.TableName = "someName";
Hopefully that will help someone.