I am using some sample code from gotdotnet to Create DataSet mappings from a
xsd schema. I am geting this error. code and error below. I might mention
there is also a publictypelibra ry file with this file I may have to use it in
some way. I am very new at XML so some examples or articles would be helpfull.
The error is:
Undefined complexType 'http://www.adsml.org/typelibrary/1.1:MLItemType' is
used as a base for complex type extension."
The code Is:
Imports System
Imports System.IO
Imports System.Xml
Partial Class _Default
Inherits System.Web.UI.P age
Dim myLoadSchema As String
Dim myXmlDataDocume nt As XmlDataDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
myLoadSchema = Request.MapPath ("BookingsMa in-AS.xsd")
'This file was also with this file Bookings-PublicTypeLibra ry-AS.xsd
Run(myLoadSchem a)
End Sub
Public Sub Run(ByVal args As String)
Try
myXmlDataDocume nt = New XmlDataDocument ()
Response.Write( "Creating an XmlDataDocument ...")
ParseSchema(arg s)
DisplayTableStr ucture()
Catch e As exception
Response.Write( "Exception: " & e.ToString())
End Try
End Sub
' Loads a specified schema into the DataSet
Public Sub ParseSchema(ByV al schema As String)
Dim myStreamReader As StreamReader = Nothing
Try
myStreamReader = New StreamReader(sc hema)
Response.Write( "Reading Schema file ...")
'*************
myXmlDataDocume nt.DataSet.Read XmlSchema(myStr eamReader)
'********Error is here in the ReadXmlSchema
Catch e As exception
Response.Write( "Exception: " & e.ToString())
Finally
If Not myStreamReader Is Nothing Then
myStreamReader. Close()
End If
End Try
End Sub
' Displays the DataSet tables structure
Private Sub DisplayTableStr ucture()
Response.Write( " ")
Response.Write( "Table structure")
Response.Write( " ")
Response.Write( "Tables count=" &
myXmlDataDocume nt.DataSet.Tabl es.Count.ToStri ng())
Dim i, j As Integer
For i = 0 To (myXmlDataDocum ent.DataSet.Tab les.Count - 1)
Response.Write( "TableName= '" &
myXmlDataDocume nt.DataSet.Tabl es(i).TableName & "'.")
Response.Write( "Columns count=" &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns.C ount.ToString() )
For j = 0 To (myXmlDataDocum ent.DataSet.Tab les(i).Columns. Count
- 1)
Response.Write( Strings.Chr(9) & "ColumnName ='" &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns(j ).ColumnName & "', type = " &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns(j ).DataType.ToSt ring())
Next
Response.Write( " ")
Next
End Sub
End Class
Thank you
--
Jerry
xsd schema. I am geting this error. code and error below. I might mention
there is also a publictypelibra ry file with this file I may have to use it in
some way. I am very new at XML so some examples or articles would be helpfull.
The error is:
Undefined complexType 'http://www.adsml.org/typelibrary/1.1:MLItemType' is
used as a base for complex type extension."
The code Is:
Imports System
Imports System.IO
Imports System.Xml
Partial Class _Default
Inherits System.Web.UI.P age
Dim myLoadSchema As String
Dim myXmlDataDocume nt As XmlDataDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
myLoadSchema = Request.MapPath ("BookingsMa in-AS.xsd")
'This file was also with this file Bookings-PublicTypeLibra ry-AS.xsd
Run(myLoadSchem a)
End Sub
Public Sub Run(ByVal args As String)
Try
myXmlDataDocume nt = New XmlDataDocument ()
Response.Write( "Creating an XmlDataDocument ...")
ParseSchema(arg s)
DisplayTableStr ucture()
Catch e As exception
Response.Write( "Exception: " & e.ToString())
End Try
End Sub
' Loads a specified schema into the DataSet
Public Sub ParseSchema(ByV al schema As String)
Dim myStreamReader As StreamReader = Nothing
Try
myStreamReader = New StreamReader(sc hema)
Response.Write( "Reading Schema file ...")
'*************
myXmlDataDocume nt.DataSet.Read XmlSchema(myStr eamReader)
'********Error is here in the ReadXmlSchema
Catch e As exception
Response.Write( "Exception: " & e.ToString())
Finally
If Not myStreamReader Is Nothing Then
myStreamReader. Close()
End If
End Try
End Sub
' Displays the DataSet tables structure
Private Sub DisplayTableStr ucture()
Response.Write( " ")
Response.Write( "Table structure")
Response.Write( " ")
Response.Write( "Tables count=" &
myXmlDataDocume nt.DataSet.Tabl es.Count.ToStri ng())
Dim i, j As Integer
For i = 0 To (myXmlDataDocum ent.DataSet.Tab les.Count - 1)
Response.Write( "TableName= '" &
myXmlDataDocume nt.DataSet.Tabl es(i).TableName & "'.")
Response.Write( "Columns count=" &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns.C ount.ToString() )
For j = 0 To (myXmlDataDocum ent.DataSet.Tab les(i).Columns. Count
- 1)
Response.Write( Strings.Chr(9) & "ColumnName ='" &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns(j ).ColumnName & "', type = " &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns(j ).DataType.ToSt ring())
Next
Response.Write( " ")
Next
End Sub
End Class
Thank you
--
Jerry
Comment