Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding the PK of the main table in a multitable view
Message
 
À
20/12/2007 05:42:54
John Thomason
King Richard Veterinary Centre
Leicester, Royaume Uni
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01276165
Message ID:
01277130
Vues:
20
John,

>Its a very simple scenario - the primary table is meetingattendance, members and meetings are lookup tables. There are 2 comboboxes to input the information. The members combo bindingsource = members table, bindingsourcedisplaymember = members.surname, bindingsourcevaluemember = members.memberid and the bindingvaluesourcemember = meetingattendance.memberid.
>When a record is saved, the view in the only dataviewgrid on the form is refreshed to display the full details ie the members surname and not the memberid.
>I want to sychronize the records in the view to the meetingattendance table so that if I need to delete a record I just select a record in the dataviewgrid and then click the delete button.

OK, then you can just call the DataGridView's GetCurrentRowPK() and pass that to the MeetingAttenance business object's Delete(object primaryKeyValue) method.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform