Ok, here ist the schema of the dataset. The problem seems
to be the relation in the expression column "EX".
<xs:schema id="DataSet1"
targetNamespace="
http://www.tempuri.org/DataSet1.xsd"
xmlns:mstns="
http://www.tempuri.org/DataSet1.xsd"
xmlns="
http://www.tempuri.org/DataSet1.xsd"
xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified"
elementFormDefault="qualified">
<xs:element name="DataSet1" msdata:IsDataSet="true"
msdata:Locale="de-CH">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="AIRPORT">
<xs:complexType>
<xs:sequence>
<xs:element name="CODE"
type="xs:string" />
<xs:element name="LANGUAGE"
type="xs:string" />
<xs:element name="NAME" type="xs:string"
minOccurs="0" />
<xs:element name="SHORTNAME"
type="xs:string" minOccurs="0" />
<xs:element name="COUNTRY"
type="xs:string" minOccurs="0" />
<xs:element name="STATE" type="xs:string"
minOccurs="0" />
<xs:element name="CITY" type="xs:string"
minOccurs="0" />
<xs:element name="RAILSTATION"
type="xs:decimal" minOccurs="0" />
<xs:element name="EX"
msdata:ReadOnly="true"
msdata:Expression="Parent.language_code" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LANGUAGE_CODE">
<xs:complexType>
<xs:sequence>
<xs:element name="LANGUAGE_CODE"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1"
msdata
rimaryKey="true">
<xs:selector xpath=".//mstns:AIRPORT" />
<xs:field xpath="mstns:CODE" />
<xs:field xpath="mstns:LANGUAGE" />
</xs:unique>
<xs:unique name="LANGUAGE_CODE_Constraint1"
msdata:ConstraintName="Constraint1"
msdata
rimaryKey="true">
<xs:selector xpath=".//mstns:LANGUAGE_CODE" />
<xs:field xpath="mstns:LANGUAGE_CODE" />
</xs:unique>
<xs:keyref name="LANGUAGE_CODEAIRPORT"
refer="LANGUAGE_CODE_Constraint1">
<xs:selector xpath=".//mstns:AIRPORT" />
<xs:field xpath="mstns:LANGUAGE" />
</xs:keyref>
</xs:element>
</xs:schema>
An example record passed by the Web Service looks like:
<AIRPORT diffgr:id="AIRPORT1" msdata:rowOrder="0">
<CODE>GEO</CODE>
<LANGUAGE>EN</LANGUAGE>
<NAME>Timehri Airport</NAME>
<SHORTNAME>Timehri</SHORTNAME>
<COUNTRY>GY</COUNTRY>
<CITY>GEO</CITY>
<RAILSTATION>0</RAILSTATION>
<EX>EN</EX>
</AIRPORT>
The exception thrown is:
[IndexOutOfRangeException: Cannot find relation 0.]
System.Data.DataTableRelationCollection.get_Item(Int32
index)
System.Data.LookupNode.Bind(DataTable table, ArrayList
list)
System.Data.DataExpression.Bind(DataTable table)
System.Data.DataExpression..ctor(String expression,
DataTable table, Type type)
System.Data.DataColumn.set_Expression(String value)
System.Data.Merger.MergeSchema(DataTable table)
System.Data.Merger.MergeTableData(DataTable src)
System.Data.Merger.MergeDataSet(DataSet source)
System.Data.DataSet.Merge(DataSet dataSet, Boolean
preserveChanges, MissingSchemaAction missingSchemaAction)
TestDataSetColumnBug.localhost.DataSet1.ReadXmlSerializabl
e(XmlReader reader) in
c:\inetpub\wwwroot\TestDataSetColumnBug\Web
References\localhost\Reference.cs:150
System.Data.DataSet.System.Xml.Serialization.IXmlSerializa
ble.ReadXml(XmlReader reader)
System.Xml.Serialization.XmlSerializationReader.ReadSerial
izable(IXmlSerializable serializable)
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializa
tionReader1.Read3_HelloWorldResponse() +328
[InvalidOperationException: There is an error in XML
document (1, 1204338).]
System.Xml.Serialization.XmlSerializer.Deserialize
(XmlReader xmlReader, String encodingStyle)
System.Xml.Serialization.XmlSerializer.Deserialize
(XmlReader xmlReader)
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadR
esponse(SoapClientMessage message, WebResponse response,
Stream responseStream, Boolean asyncCall)
System.Web.Services.Protocols.SoapHttpClientProtocol.Invok
e(String methodName, Object[] parameters)
TestDataSetColumnBug.localhost.DataSetService.HelloWorld
() in c:\inetpub\wwwroot\TestDataSetColumnBug\Web
References\localhost\Reference.cs:40
TestDataSetColumnBug.WebForm1.Button1_Click(Object
sender, EventArgs e) in
c:\inetpub\wwwroot\testdatasetcolumnbug\webform1.aspx.cs:5
2
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEv
entHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()