Solved

Cannot generate INSERT/UPDATE/DELETE for DataSource

Posted on 2006-11-06
2
227 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now