Solved

Cannot generate INSERT/UPDATE/DELETE for DataSource

Posted on 2006-11-06
2
251 Views
Last Modified: 2008-02-01
I am using a FormView in C# (VS2005).  I have been able to successfully add Insert/Update/Deletes when I am choosing a data source for DataGridViews.  When I hit the Advanced button with a form view that I configured, the option for generating Insert/Update/Deletes are grayed out.

Thanks
0
Comment
Question by:techhound
2 Comments
 
LVL 4

Assisted Solution

by:darkpriest
darkpriest earned 100 total points
ID: 17886359
Whats your select query?

Auto generated update/select tend to go nuts if your doing something like

Select Jimmy
from table
Where Count > 4

Well thats not a valid query but you get what i mean, custom queries.
0
 
LVL 29

Accepted Solution

by:
QPR earned 400 total points
ID: 17886388
I've found that you need to specify the datakey (primary) in the properties of the control.
This way it knows how to refer to the updated/deleted row when generating the sql statements.

delete from tablename where <datakey> = 'value'
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question