Solved

Cannot generate INSERT/UPDATE/DELETE for DataSource

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

628 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