Last post Oct 15, 2012 10:29 AM by march11
Aug 12, 2006 09:10 PM|rrrsr7205|LINK
Tried to set up a datasource to support an editable gridview on a very simple table in a design I inherited. The checkbox on the SqlDataSource wizard where you choose to generaqte INSERT, UPDATE, DELETE logic was greyed out. All I could do was SELECT.
After banging my head on the table for several hours, I finaloly discoovered why: the "design" had no primary key declared on the table in question. Once I gave it a primary key, the checkbox was enabled and I was back to getting some work done!
Moral of the story: ALWAYS have a primary key in your tables.
Sep 03, 2006 08:02 PM|koon75|LINK
I have the same problem with the greyed out selection of INSERT, UPDATE, DELETE methods while creating a DATASET. I do have a primary key!
I'm joining two tables (1st table)content PK and (2nd table)content FK. I was able to generate FILL and RETURN DATATable but unable to select the greyed out selection of insert, update and delete methods.
I tried adding a PK in the 2nd table but same thing happen.
Appreciate advice. Anyone
Sep 05, 2006 01:02 PM|rrrsr7205|LINK
Sep 05, 2006 01:15 PM|Caddre|LINK
[quote user="rrrsr7205"]Were you trying to update/insert based on a JOIN query? If so, try instead using subqueries vs. JOINs. I beloieve the wizards have some difficulty in determining the updateability of a JOIN-based datasource
It is not the wizard JOIN in ANSI SQL is part of Algebra Idempotent Law where the data cannot be changed through a JOIN operation and yes Subquery is the correct thing to use because they are like JOIN but updatable. SQL Server T-SQL can let you update
JOIN so if you must update JOIN then use stored proc and in SQL Server 2005 be careful with your JOIN updates SQL Server may reject it because it is very ANSI SQL compliant. Hope this helps.
Dec 03, 2007 05:14 PM|vpolv|LINK
For some reason INSERT is not getting displayed even though I selected INSERT,UPDATE AND DELETE.
Can you give me some idea?
Oct 15, 2012 10:29 AM|march11|LINK
Try using a DataList instead of Gridview.