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

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -