Solved

Cannot generate INSERT/UPDATE/DELETE for DataSource

Posted on 2006-11-06
2
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 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