Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
There's got to be an easier way to sync two tables
Message
De
23/06/2007 01:25:01
 
 
À
22/06/2007 12:16:23
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01235060
Message ID:
01235152
Vues:
24
Tony,

I have no idea if there's an "MM approved" way of doing this (I don't use MM), but I'd probably handle it with a DataView and it's RowFilter.

As you navigate through your Equipment table, change the RowFilter of your Facilities view:
Facilities.DefaultView.RowFilter = "Id = " + FacilityID.ToString();
That should do the trick.

~~Bonnie





>I was looking at the example in the manual "Synchronizing Data Bound User Interface Controls" and it seems that this is more code than is needed to sync a control.
>
>I have an Equipment table that has a field, FacilityId (integer), that I want linked to another table, Facilities with an Id (integer) field that is the key field, so that as I navigate the Equipment table, the text box on the form will show the name in the Facility table:
>
>Equipment
> FacilityId --> Facilities.Id
>
>On my form is a text field that is bound to the Name field in the Facilities table.
>
>FacilityName.Text --> Facilities.Name
>
>But I can't get this to work simply.
>
>I have already created a routine when a row's data is 'Retrieved' I save the Id and then use a Select command to get the Facility's name. This too seems like overkill.
>
>This is so easy in FoxPro by just relating the the two tables.
>
>Any idea's as to how to do this?
>
>Thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform