Do External Mapping Files work with VB 9?

I receive a "The type 'DLinqXMLMapping.XmlMap.Customers' is not an entity" exception when executing the last line of the following VB code:

Private dcNwind As XmlMap.Northwind

...

Private Sub XMLMapping_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim strMapSource As String = Application.StartupPath + "\NwindMap.xml"

Dim xmsNwind As XmlMappingSource = XmlMappingSource.FromXml(File.ReadAllText(strMapSource))

dcNwind = New XmlMap.Northwind(My.Settings.NorthwindConnection, xmsNwind)

End Sub

The XmlMap.Northwind class and NwindMap.xml file were created with this command:

"\program files\linq preview\bin\sqlmetal" /server:.\SQLEXPRESS
/database:Northwind /map:NwindMap.xml /namespace:XmlMap
/language:vb /code:Northwind.vb

There appears to be no problem when executing the C# equivalent. Any ideas

--rj

P.S. The code sample in the DLinq Overview for VB Developers.doc file's section "7.4 External Mapping" won't compile and the generated types don't correspond with the sample doc (e.g., XmlMap.Products (plural), not XmlMap.Product (singular)).

 



Answer this question

Do External Mapping Files work with VB 9?

  • Kendsr

    I fixed the issue with plural object names (by adding the /pluralize option) but (as expected) that didn't eliminate the reported exception.

    --rj


  • Do External Mapping Files work with VB 9?