expression in data column and Type GUID

D

Dirk W

in my app I have two tables, which are connected with a datarelation.
Now I want to include a new datacolumn in the master table with an
expression that shows the number of rows in the detail table. My idea
was to simply count over the ID column of the detail table which is of
type GUID.

dsCard.Relations.Add("relLesson_LessonCard",
dsCard.Tables["Lesson"].Columns["ID"],
dsCard.Tables["LessonCard"].Columns["IDLession"]);

// Add a column to Lesson with the number of child rows
dsLCard.Tables["Lesson"].Columns.Add("NoCards", typeof(int),
"count(Child(relLesson_LessonCard).ID)");

I get a dataexception 'Invalid usage of aggregate function Count()
andf Type: GUID'.

Is there any possibility to count a column of type GUID (I don't have
any other column types in this table)? If not, how should I solve this
problem?

Thanks

Dirk
 
D

Dirk W

Anybody out there who has at least some ideas or comments to my post?

I also would appreciate if you had any work arounds for this issue.

Perhaps the solution I was aiming for with Count(Child...) was just
too ambitious and could be done easier by another way.

Dirk
 

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