Can't create XmlMappingSource via FromReader method.
Posted: Thu 19 Jun 2014 10:37
Hi,
I try to create XmlMappingSource dynamically with following code:
And I get the following System.InvalidOperationException on last line of code:
When I create XmlMappingSource from static xml via XmlMappingSource.FromXlm method everything works fine!
Can you point me in the right direction?
Thanks!
I try to create XmlMappingSource dynamically with following code:
Code: Select all
XNamespace ns = @"http://schemas.devart.com/linqconnect/mapping";
XElement database = new XElement(ns + "Database",
new XAttribute("Provider", "Devart.Data.Oracle.Linq.Provider.OracleDataProvider, Devart.Data.Oracle.Linq, Version=4.4.509.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701"),
new XAttribute("Name", string.Empty));
var column = new XElement(ns + "Column", new XAttribute("Member", "Name"), new XAttribute("Name", "Name"));
var type = new XElement(ns + "Type", new XAttribute("Name", "ObjType"), column);
database.Add(new XElement(ns + "Table", new XAttribute("Name", "Obj$types"), type));
DataContext dc = new Context(conn, Devart.Data.Linq.Mapping.XmlMappingSource.FromReader(database.CreateReader()));
Code: Select all
"Database node not found 'http://schemas.microsoft.com/linqtosql/mapping/2007', 'http://schemas.microsoft.com/linqtosql/dbml/2007' or 'http://schemas.devart.com/linqconnect/mapping'."}
Can you point me in the right direction?
Thanks!