[Mono-list] Dataset.Merge crash
MrGadget
gadget at ccrtc.com
Fri May 15 13:40:30 EDT 2009
I have a webservice that creates and returns a new dataset (NewDataSet)
containing 1 or more filled tables.
In my winforms app I have a dataset (MyDataset) to which I merge the dataset
from the webservice.
First call to the webservice, when MyDataset is empty, this works fine and
MyDataset correctly has what came from the webservice in NewDataSet.
MyDataset.Merge(NewDataSet, True)
Subsequent calls the the webservice will return again NewDataSet that may
have new tables and/or tables already present in MyDataset to be merged into
MyDataset but the merge fails with the following:
System.InvalidCastException: Cannot cast from source type to destination
type.
at System.Data.DataViewManager.CollectionToListChangeEventArgs
(System.ComponentModel.CollectionChangeEventArgs e) [0x00038] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\DataViewManager.cs:423
at System.Data.DataViewManager.TableCollectionChanged (System.Object
sender, System.ComponentModel.CollectionChangeEventArgs e) [0x00000] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\DataViewManager.cs:411
at System.Data.DataTableCollection.OnCollectionChanged
(System.ComponentModel.CollectionChangeEventArgs ccevent) [0x0000b] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\DataTableCollection.cs:265
at System.Data.DataTableCollection.Add (System.Data.DataTable table)
[0x000f2] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\DataTableCollection.cs:141
at System.Data.MergeManager.AdjustSchema (System.Data.DataSet targetSet,
System.Data.DataTable sourceTable, MissingSchemaAction missingSchemaAction,
System.Data.DataTable& newTable) [0x0004a] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\MergeManager.cs:276
at System.Data.MergeManager.Merge (System.Data.DataSet targetSet,
System.Data.DataTable sourceTable, Boolean preserveChanges,
MissingSchemaAction missingSchemaAction) [0x00032] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\MergeManager.cs:62
at System.Data.MergeManager.Merge (System.Data.DataSet targetSet,
System.Data.DataSet sourceSet, Boolean preserveChanges, MissingSchemaAction
missingSchemaAction) [0x0004d] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\MergeManager.cs:45
at System.Data.DataSet.Merge (System.Data.DataSet dataSet, Boolean
preserveChanges, MissingSchemaAction missingSchemaAction) [0x00027] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\DataSet.cs:265
at System.Data.DataSet.Merge (System.Data.DataSet dataSet, Boolean
preserveChanges) [0x00000] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.4\mcs\class\System.Data\System.Data\DataSet.cs:245
--
View this message in context: http://www.nabble.com/Dataset.Merge-crash-tp23564411p23564411.html
Sent from the Mono - General mailing list archive at Nabble.com.
More information about the Mono-list
mailing list