"Specified cast is not valid" when generating dataset

P

pldurrer

I have a dataset defined as follows:

<?xml version="1.0" standalone="yes" ?>
<xs:schema id="dsEscheatment"
targetNamespace="http://www.tempuri.org/dsEscheatment.xsd"
xmlns:mstns="http://www.tempuri.org/dsEscheatment.xsd"
xmlns="http://www.tempuri.org/dsEscheatment.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="dsEscheatment" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Payee">
<xs:complexType>
<xs:sequence>
<xs:element name="PayeeID" type="xs:int" />
<xs:element name="PayeeFirstName" type="xs:string"
minOccurs="0" />
<xs:element name="PayeeLastName" type="xs:string"
minOccurs="0" />
<xs:element name="PayeeFullName" type="xs:string"
minOccurs="0" />
<xs:element name="PayeeStreetAddress1"
type="xs:string" minOccurs="0" />
<xs:element name="PayeeStreetAddress2"
type="xs:string" minOccurs="0" />
<xs:element name="PayeeCity" type="xs:string"
minOccurs="0" />
<xs:element name="PayeeState" type="xs:string" />
<xs:element name="PayeeZip" type="xs:string"
minOccurs="0" />
<xs:element name="PayeeTIN" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FundTransfer">
<xs:complexType>
<xs:sequence>
<xs:element name="TransferID" msdata:ReadOnly="true"
msdata:AutoIncrement="true" type="xs:int" />
<xs:element name="UnitNumber" type="xs:string" />
<xs:element name="BankName" type="xs:string" />
<xs:element name="BankAccountNumber" type="xs:string"
/>
<xs:element name="TransferType" type="xs:string" />
<xs:element name="RemitCheckNumber" type="xs:int" />
<xs:element name="RemitCheckAmount" type="xs:decimal"
/>
<xs:element name="PreparedByNetworkName"
type="xs:string" />
<xs:element name="PreparedByName" type="xs:string" />
<xs:element name="DateSubmitted" type="xs:dateTime"
minOccurs="0" />
<xs:element name="Status" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FundTransferPayee">
<xs:complexType>
<xs:sequence>
<xs:element name="TransferID" type="xs:int"
minOccurs="0" />
<xs:element name="PayeeID" type="xs:int"
minOccurs="1" maxOccurs="2" />
<xs:element name="AmountRemitted" type="xs:decimal"
/>
<xs:element name="DueDiligenceDate" type="xs:date"
nillable="true" />
<xs:element name="OutstandingCheckDate"
type="xs:date" minOccurs="0" />
<xs:element name="OutstandingCheckNumber"
type="xs:int" minOccurs="0" />
<xs:element name="OutstandingCaseNumber"
type="xs:string" minOccurs="0" />
<xs:element name="EscrowDate" type="xs:date"
minOccurs="0" />
<xs:element name="EscrowCaseNumber" type="xs:string"
minOccurs="0" />
<xs:element name="CareOfName" type="xs:string"
minOccurs="0" />
<xs:element name="StateOwnerCode" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>

<xs:unique name="FundTransfer_Constraint1"
msdata:ConstraintName="Constraint1" msdata:primaryKey="true">
<xs:selector xpath=".//mstns:FundTransfer" />
<xs:field xpath="mstns:TransferID" />
</xs:unique>
<xs:keyref name="FundTransferFundTransferPayee"
refer="mstns:FundTransfer_Constraint1" msdata:IsNested="true"
id="PayeeRelation">
<xs:selector xpath=".//mstns:FundTransferPayee" />
<xs:field xpath="mstns:TransferID" />
</xs:keyref>
<xs:key name="PayeeIDKey" msdata:primaryKey="true">
<xs:selector xpath=".//mstns:payee" />
<xs:field xpath="mstns:payeeID" />
</xs:key>
<xs:keyref name="ItemPayee" refer="mstns:payeeIDKey">
<xs:selector xpath=".//mstns:FundTransferPayee" />
<xs:field xpath="mstns:payeeID" />
</xs:keyref>
</xs:element>
</xs:schema>

when I compile my program I receive the following message:

"Custom tool error: Unable to convert input xml file content to a
DataSet. Specified cast is not valid."

It will compile successfully if I remove the "ItemPayee" relation.
What am I missing here?

Thanks,
Preston
 
S

Scott M.

Well, first off, this isn't a dataset, it is an XML Schema Document (xsd)
that descibes the data structure of a dataset.

Second, I notice that your error message says "Custom Tool" in it. What are
you doing with this XSD that is causing the error?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top