PC Review


Reply
Thread Tools Rate Thread

Expression column based on child will always return null

 
 
Jason Goodwin
Guest
Posts: n/a
 
      26th Aug 2003
Hello, I have a problem that's been driving me nuts. I'm
creating typed DataSets, but I can't seem to get an
expression column to work properly if it is using data
from a child column. Using Parent in an expression on the
child table works, as well as using GetChildRows from a
data row. However, querying the column for that row will
always return a null result.

The expression I am using is: "Count(Child
(CustomerInfoAccountNumbers).AccountNumber)"

The names for the relation and child column are correct,
and I always get a null result regardless of what
aggregation expression is used.


The XSD of the data set (named CustomerSearchResults) is:

<?xml version="1.0" standalone="yes" ?>
<xs:schema id="CustomerSearchResults"
targetNamespace="http://www.tempuri.org/CustomerSearchResu
lts.xsd"
xmlns:mstns="http://www.tempuri.org/CustomerSearch
Results.xsd"
xmlns="http://www.tempuri.org/CustomerSearchResults.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified"
elementFormDefault="qualified">
<xs:element name="CustomerSearchResults"
msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element
name="CustomerInfo">
<xs:complexType>

<xs:sequence>

<xs:element name="CustomerID"
msdata:AutoIncrement="true" type="xs:int" minOccurs="0" />

<xs:element name="TaxID" type="xs:string"
minOccurs="0" />

<xs:element name="FirstName" type="xs:string"
minOccurs="0" />

<xs:element name="LastName" type="xs:string"
minOccurs="0" />

<xs:element name="Age" type="xs:int"
minOccurs="0" />

<xs:element name="AccountNumber" type="xs:int"
minOccurs="0" msdata:Expression="Min(Child
(CustomerInfoAccountNumbers).AccountNumber)"

msdata:ReadOnly="true" />

</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="AddressInfo">
<xs:complexType>

<xs:sequence>

<xs:element name="CustomerID" type="xs:int"
minOccurs="0" />

<xs:element name="AddressID" type="xs:int"
minOccurs="0" />

<xs:element name="Address1" type="xs:string"
minOccurs="0" />

<xs:element name="AddressType" type="xs:string"
minOccurs="0" />

<xs:element name="City" type="xs:string"
minOccurs="0" />

<xs:element name="State" type="xs:string"
minOccurs="0" />

<xs:element name="ZipCode" type="xs:string"
minOccurs="0" />

</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="AccountNumbers">
<xs:complexType>

<xs:sequence>

<xs:element name="CustomerID" type="xs:int"
minOccurs="0" />

<xs:element name="AccountNumber" type="xs:int"
minOccurs="0" />

</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:key name="CustomerSearchResultsKey2"
msdata:PrimaryKey="true">
<xs:selector
xpath=".//mstns:AccountNumbers" />
<xs:field
xpath="mstns:CustomerID" />
<xs:field
xpath="mstns:AccountNumber" />
</xs:key>
<xs:key name="CustomerSearchResultsKey1"
msdata:PrimaryKey="true">
<xs:selector
xpath=".//mstns:CustomerInfo" />
<xs:field
xpath="mstns:CustomerID" />
</xs:key>
<xs:keyref name="CustomerInfoAddressInfo"
refer="mstns:CustomerSearchResultsKey1">
<xs:selector
xpath=".//mstns:AddressInfo" />
<xs:field
xpath="mstns:CustomerID" />
</xs:keyref>
<xs:keyref
name="CustomerInfoAccountNumbers"
refer="mstns:CustomerSearchResultsKey1">
<xs:selector
xpath=".//mstns:AccountNumbers" />
<xs:field
xpath="mstns:CustomerID" />
</xs:keyref>
</xs:element>
</xs:schema>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return parent based on child =?Utf-8?B?RVM=?= Microsoft Access Queries 1 21st Nov 2006 04:55 PM
expression which will return a result based on different conditio. =?Utf-8?B?ZGhhcm5vaXM=?= Microsoft Access VBA Modules 1 8th Sep 2004 11:06 PM
Problem with Expression Column when deleting all child rows. moondaddy Microsoft ADO .NET 3 28th Jun 2004 10:11 AM
Null Values in child column of ForeignKeyConstraint George Plummer Microsoft ADO .NET 2 19th May 2004 05:48 AM
Expression column is Null? Bill Todd Microsoft ADO .NET 8 17th Mar 2004 08:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:21 AM.