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 (show other bugs)
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: 2017-06-16 13:26 UTC (History)
4 users (show)

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


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?

Note You need to log in before you can comment on or make changes to this bug.