Silverlight / WPF - Insert a line HELP""""""" - Asked By David on 27-Jan-12 04:19 PM

Hi All
I have asked many times and I am still no closer to making the insert command work.
I am using an access 2007 data base and wpf window with a Datagrid view to select the Prikey I want to insert a complete row of data from COURSE - Table into COURSES_PLAYED table  using the tableadapter insert command query.
What code do I need to put in before and after the query to make it run.
Should I be using Add new item button or creating a new one.?
Am I using the wrong type of form.?

INSERT INTO [COURSES PLAYED]
SELECT   COURSEName, H1PAR, H2PAR, H3PAR, H4PAR, H5PAR, H6PAR, H7PAR, H8PAR, H9PAR, H10PAR, H11PAR, H12PAR, H13PAR, H14PAR, H15PAR,
        H16PAR, H17PAR, H18PAR, H1SC, H2SC, H3SC, H4SC, H5SC, H6SC, H7SC, H8SC, H9SC, H10SC, H11SC, H12SC, H13SC, H14SC, H15SC, H16SC,
        H17SC, H18SC, H1TEE, H2TEE, H3TEE, H4TEE, H5TEE, H6TEE, H7TEE, H8TEE, H9TEE, H10TEE, H11TEE, H12TEE, H13TEE, H14TEE, H15TEE,
        H16TEE, H17TEE, H18TEE, H1FWAY, H2FWAY, H3FWAY, H4FWAY, H5FWAY, H6FWAY, H7FWAY, H8FWAY, H9FWAY, H10FWAY, H11FWAY,
        H12FWAY, H13FWAY, H14FWAY, H15FWAY, H16FWAY, H17FWAY, H18FWAY, BUNK1, BUNK2, BUNK3, BUNK4, BUNK5, BUNK6, BUNK7, BUNK8,
        BUNK9, BUNK10, BUNK11, BUNK12, BUNK13, BUNK14, BUNK15, BUNK16, BUNK17, BUNK18, PUTT1, PUTT2, PUTT3, PUTT4, PUTT5, PUTT6, PUTT7,
        PUTT8, PUTT9, PUTT10, PUTT11, PUTT12, PUTT13, PUTT14, PUTT15, PUTT16, PUTT17, PUTT18, GR1, GR2, GR3, GR4, GR5, GR6, GR7, GR8, GR9,
        GR10, GR11, GR12, GR13, GR14, GR15, GR16, GR17, GR18, BUNK1OUT, BUNK2OUT, BUNK3OUT, BUNK4OUT, BUNK5OUT, BUNK6OUT, BUNK7OUT,
        BUNK8OUT, BUNK9OUT, BUNK10OUT, BUNK11OUT, BUNK12OUT, BUNK13OUT, BUNK14OUT, BUNK15OUT, BUNK16OUT, BUNK17OUT, BUNK18OUT,
       H1YDS, H2YDS, H3YDS, H4YDS, H5YDS, H6YDS, H7YDS, H8YDS, H9YDS, H10YDS, H11YDS, H12YDS, H13YDS, H14YDS, H15YDS, H16YDS,
        H17YDS, H18YDS
FROM   COURSE
WHERE   (Prikey3 = ?)

THE QUERY RUNS IN EDIT MODE AND INSERTS FROM TABLE1 TO TABLE2 ONE ROW ONLY AS ASKED FOR
BUT I CANT CODE AND RUN IT "HELP"

Thanks again David


David replied to Venkat K on 01-Feb-12 04:13 PM
Hi All

Above is not the answer I was looking for,  I want to know how to Code and run a query when the progamme is in run mode. Is there any one that can tell me if I am doing it the wrong way using a Datagridview etc
If I should change to some other way of making the selected cell/button run the code.
I can do it in Access but not in Visual Studio a package I purchased when I retired to give me some challenge and this it has done for 2 years and still no nearer finishing it.

Thanks for any help
 David