Starr Duskk
asked on
XML: incomplete content error
I am looking at this tutorial:
http://www.codeproject.com/KB/aspnet/xmlguestbook.aspx
The very last line:
</NewDataSet>
Gives this error:
The element 'NewDataSet' h as incplete content. List of possible elements expected: 'guestbook'.
What is wrong with this example? How do I fix it?
thanks.
http://www.codeproject.com/KB/aspnet/xmlguestbook.aspx
The very last line:
</NewDataSet>
Gives this error:
The element 'NewDataSet' h as incplete content. List of possible elements expected: 'guestbook'.
What is wrong with this example? How do I fix it?
thanks.
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="guestbook">
<xs:complexType>
<xs:sequence>
<xs:element name="id" msdata:AutoIncrement="true"
msdata:AutoIncrementSeed="1" type="xs:int" />
<xs:element name="datetime" type="xs:dateTime"
minOccurs="0" />
<xs:element name="author" type="xs:string"
minOccurs="0" />
<xs:element name="subject" type="xs:string"
minOccurs="0" />
<xs:element name="comments" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//guestbook" />
<xs:field xpath="id" />
</xs:unique>
</xs:element>
</xs:schema>
</NewDataSet>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried both, now I'm getting the error:
Value cannot be null. Parameter name: url
It is in this function:
Sub PopulateDataSet()
myDataSet = New DataSet()
myDataSet.ReadXml(strFileP ath, XmlReadMode.ReadSchema)
End Sub
on this line:
myDataSet.ReadXml(strFileP ath, XmlReadMode.ReadSchema)
I'm not understanding how it is finding my dataset anyway. In his code, there is no reference to "NewDataSet" anywhere.
What directory do I put the .xsd file in? I have it in app_code/xmlSchemas.
thanks.
Value cannot be null. Parameter name: url
It is in this function:
Sub PopulateDataSet()
myDataSet = New DataSet()
myDataSet.ReadXml(strFileP
End Sub
on this line:
myDataSet.ReadXml(strFileP
I'm not understanding how it is finding my dataset anyway. In his code, there is no reference to "NewDataSet" anywhere.
What directory do I put the .xsd file in? I have it in app_code/xmlSchemas.
thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The strFilePath already has the servermappath previously set.
strFilePath = Server.MapPath("guestbook. xml")
strFilePath = Server.MapPath("guestbook.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Okay, I'm going to close this out and start a new ticket. I'm getting more errors. But different.
thanks!
thanks!
too late in the show :-)