Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cannot generate INSERT/UPDATE/DELETE for DataSource

Posted on 2006-11-06
2
Medium Priority
?
282 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:James Cochrane
2 Comments
 
LVL 4

Assisted Solution

by:darkpriest
darkpriest earned 400 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 1600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

916 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