Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 4th, 2007, 01:53 PM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataColumn.Expression problem

Hi everyone,

Ok, I hope I can be thorough with my explanation....In my VB.net 2005 app have a databse with 2 tables - structure as follows:

[u]Dept</u>
    DeptID (PK),
    DeptName

[u]Documents</u>
    DocumentID (PK),
    DocumentName,
    Active,
    DeptID (FK on Table1)

Now, I have pulled in these 2 tables into my Dataset. In the dataset designer, I add a column to Dept and call it NumberActive (this is supposed to be a count of rows where Documents.DeptID = Dept.DeptID AND Documents.Active = True)

In a listbox bound to DeptBindingSource, another label on the form is supposed to be bound to NumberActive, so everytime the Listbox's SelectedIndexChanged event fires, the label will be refreshed with a count of Active documents for that department. Unfortunately, the label shows as '0' when I the form loads or when the selected index changes.

The expression that I am using for the in-designer-added column, NumberActive, is as follows:

Count(Child(FK_Documents_Dept).Active) = True

I have not done any additional coding behind the scenes, and I'm not sure if its necessary? Getting nowhere also searching Google.

Any help with this would be very much appreciated !

Thanx guys/gals!
- Shalan





Similar Threads
Thread Thread Starter Forum Replies Last Post
Field not a DataColumn or DataRelation flashmanTom SQL Server 2005 0 January 30th, 2008 09:55 AM
Field not a DataColumn or DataRelation flashmanTom Visual Studio 2005 0 January 26th, 2008 02:50 PM
DataColumn.Expression problem in Dataset designer shalan Pro Visual Basic 2005 2 October 5th, 2007 06:28 PM
Manipulating DataColumn BSkelding VB.NET 2002/2003 Basics 1 January 28th, 2005 12:11 PM
copy datacolumn from one dataset to another hkpanda ADO.NET 1 July 25th, 2003 12:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.