473,761 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS2005: DataSet Parent not returning a value

In Visual Studio 2005 SP1,

I added a DataSet item into my project.

I added 3 tables from SQL that have data and relationships.

I added 2 lookup columns (lkp) to the DllVersions table in the dataset

[Project]
ProjectID
ProjectName

[Servers]
ServerID
ServerName

[DllVersions]
DllVersionID
ProjectID
ServerID
DllVersion
lkpServerName (not in SQL)
lkpProjectName (not in SQL)
I want the lkp Columns to return the Name from the associated ID in the
parent table.

So in the DataSet, I click properties and set the Expression for
lkpServerName to
Parent(FK_DllVe rsions_Servers) .ServerName

lkpProjectName to
Parent(FK_DllVe rsions_Projects ).ProjectName

I can preview the data for any table in the dataset and it's all there.
The code is working because it does not throw an exception. However, it
does not display any data in either of the lkp columns.

What's going on here?

Jan 10 '07 #1
4 1888
how are u loading the dataset?
Jan 10 '07 #2
Wouldn't that just be "Parent.ServerN ame"?

<q>A parent table may be referenced in an expression by prepending the
column name with Parent. For example, the Parent.Price references the
parent table's column named Price.

A column in a child table may be referenced in an expression by
prepending the column name with Child. However, because child
relationships may return multiple rows, you must include the reference
to the child column in an aggregate function. For example,
Sum(Child.Price ) would return the sum of the column named Price in the
child table.

If a table has more than one child, the syntax is: Child(RelationN ame).
For example, if a table has two child tables named Customers and
Orders, and the DataRelation object is named Customers2Order s, the
reference would be as follows:

Avg(Child(Custo mers2Orders).Qu antity)</q>

http://msdn2.microsoft.com/en-us/lib...xpression.aspx

Marc

Jan 10 '07 #3
Nope...

Parent.ColumnNa me is for when there is only one relationship on the
table.

Marc Gravell wrote:
Wouldn't that just be "Parent.ServerN ame"?

<q>A parent table may be referenced in an expression by prepending the
column name with Parent. For example, the Parent.Price references the
parent table's column named Price.

A column in a child table may be referenced in an expression by
prepending the column name with Child. However, because child
relationships may return multiple rows, you must include the reference
to the child column in an aggregate function. For example,
Sum(Child.Price ) would return the sum of the column named Price in the
child table.

If a table has more than one child, the syntax is: Child(RelationN ame).
For example, if a table has two child tables named Customers and
Orders, and the DataRelation object is named Customers2Order s, the
reference would be as follows:

Avg(Child(Custo mers2Orders).Qu antity)</q>

http://msdn2.microsoft.com/en-us/lib...xpression.aspx

Marc
Jan 10 '07 #4
Then I stand corrected. I must admit I don't do a lot of DataSet work
and was basing this on the docs (cited).

Marc
Jan 10 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8590
by: Fleckman | last post by:
I have a situation where I need to add rows to tables with a Parent-Child relationship which presents a constraints violation when I reject the changes. Here is the scenario: I add a row to a Parent table which then causes a row to be added to the Child table referencing the parent row. The Child table rows can be modified by multiple processes so I need to manage row additionals separate from row modifications in terms of how they are...
3
1804
by: dbuchanan | last post by:
Hello, How do I create a Parent-Child relationship between two DataGridView in a form using TableAdapters. The two tables already have a relationship defined in the dataset. What event do I use to update the child dgv? The RowEnter event? Thank you, dbuchanan
5
1995
by: GaryDean | last post by:
(my original post was inaccurate but this post accurately describes what I think is a very bad vs2005 bug) short description... Deleting a dataset and recreating it from the dataadapter causes VS.Net 2005 to render the associated .resx and .vb file inoperative. detail... I converted an asp 1.1 vb.net app using the vs2005 conversion wizard and then retested the app after conversion.
2
1869
by: Bob | last post by:
I have noticed that as one adds related tables to a bindingsource and dataset(vs2005 Vb.Net Sql Server 2005), the TODO and following code that fills the datasets on form load are written to the formload event in the order in which you drag the tables to the form to make a gridview, the last table you drag is written to the top. Since you normallly start by dragging the parent table and then the child tables and grandchild tables, what...
1
1734
by: Efi | last post by:
we have a typed dataset with 2 tables - parent and child with relation and foreign key constraint. after adding 1 parent row to the parent table with 1 related(!) child row to the child table we have the following problem that never occured in VS2003: both new rows states (each one in it's table) is "added", but after adding the parent row to the parent table, it automatically changes the state of the new child row to "modified" instead...
0
1132
by: Michael | last post by:
Okay, maybe I am missing something. I created a dataset through VS2005 data manager. The set includes tables with child relationships. The tables and the relationships are included in the dataset. I simply create a data source and then select the tables I want. I edit the relationships to make sure they are correct. I can then expand the dataset in the data source pane and see there is a relationship. Now, when I attach this dataset to...
4
1971
by: SteveT | last post by:
I am wanting to populate several treeviews, one for the <TRs> group and one for the <TGsgroup. Is there a simplier way to populate the Treeview than the one I did below? It seems difficult to get to the correct DataSet values. <?xml version="1.0" encoding="utf-8" ?> <TestSample> <TRs> <TR1>
21
2431
by: Peter Bradley | last post by:
Hi all, This post is sort of tangentially related to my earlier posts on configuration files for DLLs. Does anyone know how to create typed DataSets using VS2005's new DataSet designer, but with the ability to configure the connection string via a config file? The designer seems to hard-code the connection string into the dataset itself, which just can't be right.
2
1403
by: active T | last post by:
Hi, I've build a application, and this is the first time that i try to use the dataset (designer) from VS. It seems to be very intressing building a dataaccesslayer into my application. I use stored procedures for the actions on the databases. This working fine. But now i want to use the return value of the SP. Ik can do actions on the database and can say RETURN 0 of RETURN @@Error.
0
9377
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.