https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361451
Before vs 2008 sp1, I have a property who's type is XElement in Linq to SQL designer.
I set the 'Server Data Type' value in property grid to 'xml', and it works fine.
However, after installed the sp, it doesn't compile, here is the error message:
---------
Error 27 DBML1005: Mapping between DbType 'xml' and Type 'System.Xml.Linq.XElement' in Column 'Data' of Type 'Sale' is not supported. 0 0
---------
On the other hand, if I create a new table in SQL Server 2005 with a 'xml' column type, then drag and drop the table from Server Explorer to the dbml designer interface, the entity generated also maps to 'XElement' automatically, and has a 'Server Data Type' of 'Xml', it doesn't compile either.
So I think this is an bug, if there are any walk arounds please tell me. thanks very much.
The third way, if I leave the 'Server Data Type' property to blank, and set the column type in SQL Server 2005 to 'xml' manulely, the project compiles successfully. However, the 'CreateDatabase' method of the DataContext will fail.
here is the code:
===
var db = new testDataContext();
if (! db.DatabaseExists())
db.CreateDatabase();
===
This will produce the following error:
"无法确定“System.Xml.Linq.XElement”的 SQL 类型。"
(in English maybe it's identical to "The SQL type of 'System.Xml.Linq.XElement' is not sure'.)
This bug makes me very hard to automatically generate database from Linq to SQL side, or the reverse way, both direction need some manual adjustments.
Before vs 2008 sp1, I have a property who's type is XElement in Linq to SQL designer.
I set the 'Server Data Type' value in property grid to 'xml', and it works fine.
However, after installed the sp, it doesn't compile, here is the error message:
---------
Error 27 DBML1005: Mapping between DbType 'xml' and Type 'System.Xml.Linq.XElement' in Column 'Data' of Type 'Sale' is not supported. 0 0
---------
On the other hand, if I create a new table in SQL Server 2005 with a 'xml' column type, then drag and drop the table from Server Explorer to the dbml designer interface, the entity generated also maps to 'XElement' automatically, and has a 'Server Data Type' of 'Xml', it doesn't compile either.
So I think this is an bug, if there are any walk arounds please tell me. thanks very much.
The third way, if I leave the 'Server Data Type' property to blank, and set the column type in SQL Server 2005 to 'xml' manulely, the project compiles successfully. However, the 'CreateDatabase' method of the DataContext will fail.
here is the code:
===
var db = new testDataContext();
if (! db.DatabaseExists())
db.CreateDatabase();
===
This will produce the following error:
"无法确定“System.Xml.Linq.XElement”的 SQL 类型。"
(in English maybe it's identical to "The SQL type of 'System.Xml.Linq.XElement' is not sure'.)
This bug makes me very hard to automatically generate database from Linq to SQL side, or the reverse way, both direction need some manual adjustments.
在安装VS 2008 SP1之前,Linq to SQL设计者中有一个XElement类型的属性,设置'Server Data Type'为'xml'工作正常。然而,更新后,编译失败,提示不支持DbType 'xml'到'Type System.Xml.Linq.XElement'的映射。创建新的SQL Server 2005表并拖放到dbml设计界面,也会出现相同错误。若不设置'Server Data Type',手动将列类型设为'xml',项目可以编译,但DataContext的'CreateDatabase'方法会失败。该问题导致从Linq to SQL自动生成数据库或反向操作都需要手动调整。

被折叠的 条评论
为什么被折叠?



