Can you use DataSet and DataTables in a Portable Class Library

瘦欲@ 提交于 2019-12-24 01:19:24

问题


I am working on a project that relies on DataSet and DataTable. We wish to move into cross platform so are looking at Portable Class Libraries. However we cant find out how to use DataSet and DataTable in a portable class library. Are they available?

Maybe we should be moving away from DataSets and DataTables but we have what we have right now.


回答1:


No the Dataset and DataTable are quite Windows specific Data structures, they would not be cross compatible, you may instead plan to serialize your result in to XML, Json, which would be available for use in all the platforms, thus achieving the inter-operability as expected, this would surely mean than in Windows you need a wrapper to de-serialize the XML / Json into relevant in memory object like DataTable




回答2:


In the Shim library that I have developed, there is basic and incomplete support for DataSets and DataTables.

Shim is a Portable Class Library which offers basic implementations of some types and methods that are available in .NET Framework but not in PCL. I developed Shim primarily to facilitate the porting of the Accord.NET Framework to various platforms via PCL. Accord.NET relies to some extent on ADO.NET and I therefore implemented the ADO.NET classes and methods Accord.NET required in Shim.

You might want to take a look at Shim here to see if it fits your needs. It is also available as NuGet packages.



来源:https://stackoverflow.com/questions/35596231/can-you-use-dataset-and-datatables-in-a-portable-class-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!