Search code examples
asp.net-core-2.1spreadsheetgear

SpreadsheetGear 2012 - 2017 Upgrade - SpreadsheetGear.data no longer valid


In Spreadsheetgear 2012, I have code below which populates a datatable and then passes it to an IRange.

My issue is that in 2017 for .netstandard (Nuget package 8.2.10), there is no SpreadsheetGear.data. I can't even locate any method of CopyFromDataTable.

range.CopyFromDataTable(datatable, SpreadsheetGear.Data.SetDataFlags.None);

There is no signs of this being deprecated, am I missing something? How do I approach this?


Solution

  • UPDATE

    Version 9 of SpreadsheetGear Engine for .NET (formerly called SpreadsheetGear for .NET Standard) is now available and adds support for all of the various DataTable- and DataSet-related APIs that were missing in the previous version. Please update your NuGet package reference to this new version to start using these APIs.

    ORIGINAL ANSWSER

    The problem is that you are comparing two entirely different products. There are two primary products offered by SpreadsheetGear (if you don't count the Silverlight product, which as we all know Silverlight is basically a dead-end technology):

    • SpreadsheetGear for .NET - this product targets the full .NET Framework and is distributed as installers on the SpreadsheetGear website's Licensed User Downloads page.
    • SpreadsheetGear for .NET Standard - this product is distributed on NuGet and currently targets .NET Standard 1.3. .NET Standard 1.3 did not support DataTables or DataSets and therefore SpreadsheetGear for .NET Standard could not, either, so is why you are not seeing these API's in this product. There are some other differences between these two products, all of which are pointed out on SpreadsheetGear's Comparison Page.

    The release of .NET Standard 2.0 added support for DataTables / DataSets. Likewise, the next major release of SpreadsheetGear for .NET Standard (V9) will target a newer version of .NET Standard and add support for SpreadsheetGear.Data namespace and related APIs. I cannot speculate on a release date for V9 (I work for SpreadsheetGear), but if you contact us directly (at support@spreadsheetgear.com), we can add you to our feature request list so that we can be sure to reach out to you when it does become available.

    Until this time, you'll just need to build your own routine to copy data to / from DataTables.