c# - How do I convert a strongly typed DataTable to an untyped DataTable -
i tried send typed datatable wcf service expecting untyped datatable same data.
however, got error because serializer didn't know properties.
how can convert typed datatable untyped equivalent?
note: basic explanation of typed vs. untyped datasets, here.
this can done simple merge command, this:
// convert stringly typed datatable "data" loosely-typed version of var data_untyped = new datatable(data.tablename, data.namespace); data_untyped.merge(data);
the first (non-comment) line creates new datatable, copying tablename , namespace.
the last line copies data, including column definitions.
Comments
Post a Comment