Bug 18623 - Datatable with primary key throws an exception when reading xml
Summary: Datatable with primary key throws an exception when reading xml
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data ()
Version: 3.2.x
Hardware: All Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-03-27 15:57 UTC by Alexandre Pepin
Modified: 2018-03-13 11:07 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Alexandre Pepin 2014-03-27 15:57:42 UTC
This code successfully reads my datable in windows :

	DataTable t = new DataTable("test");

	StringWriter sw = new StringWriter();
	t.WriteXml(sw, XmlWriteMode.WriteSchema);

	string data = sw.ToString();

	DataTable t2 = new DataTable("test");
	var c = t2.Columns.Add("col");
	c.AutoIncrement = true;
	c.AutoIncrementSeed = 1;
	t2.PrimaryKey = new[] { c };
	StringReader sr = new StringReader(data);

But it throws a System.ArgumentException saying "The column 'col' does not belong to the table : test" under mono
Comment 1 Mikayla Hutchinson [MSFT] 2014-04-01 17:39:35 UTC
Did you really mean to file this against Mono 2.8.x?
Comment 2 Alexandre Pepin 2014-04-02 09:14:20 UTC
No, it's probably the latest version of Mono. I'm using Xamarin.iOS, but I don't know which version of Mono it is
Comment 3 Alexandre Pepin 2014-05-07 18:39:59 UTC
Do you still need additional info?
Comment 4 Marek Safar 2018-03-13 11:07:18 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and reopen the bug report.

Thank you!