Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSet w/ Multiple Tables
Message
From
29/04/2004 09:19:19
Mindy Shingara
Central Susquehanna Intermediate Unit
Lewisburg, Pennsylvania, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Web forms
Title:
DataSet w/ Multiple Tables
Miscellaneous
Thread ID:
00899300
Message ID:
00899300
Views:
50
Hi,
I am working on a web form with a fox pro back end.....

PROBLEM: Trying to add a new row of data to a dataset that contains fields from 2 tables.

I have a dataset ("dsDetail") that is populated by a table ("bp_rqac") which has an outer join on another table ("bp_bidod"). I want to add a new row to my dataset ("dsDetail"), but the only way I've seen to do this is by adding a row to a datatable. So, I've created a datatable ("dtDetail") based on the dataset ("dsDetail") and added a new row to it ("dr"). The following code works fine to begin updating the fields from table("bp_rqac") in that new row ("dr")....
dr["ra_reqnr"] = this.txtrq_reqnr.Text;
dr["ra_maj"] = this.txtma_maj.Text;
dr["ra_acct"] = this.txtra_acct.Text;

However, when I try to use this code to update the fields from table ("bp_bidod") in the same datarow ("dr"), my form blows up.....
dr["bo_bldg"] = Session["bldg"];
dr["bo_reqnr"] = Session["reqnr"];
dr["bo_maj"] = Session["major"];
dr["bo_smaj"] = Session["subMajor"];
dr["bo_min"] = this.txtic_min.Text;

I get a message saying that the fields above with the prefix "bo" do not belong to table ("bp_rqac") which is correct; they belong to table ("bp_bidod"). But, there are fields from table ("bp_bidod") in the dataset ("dsDetail") from that outer join. How do I add this new row to the dataset and still have access to the fields from both tables? Do I need to create a DataRelation between the two tables? If so, could someone give me some direction on doing so?

Thanks.
Next
Reply
Map
View

Click here to load this message in the networking platform