Can't edit DataGridView

Posted on 2008-11-05
Last Modified: 2013-11-08
In ASP.NET 3.5, I'm following this example:  My LINQ source is coming from a DLL that I reference by project, in my app project.  In the datasource, I select the Advanced button allow LINQ to control edits and inserts.  I don't get the edit/inset options in the grid's smart tag until I select "*" in the datasource.  If I select a single column, the edit/insert options aren't in the smart tag.  What causes that?

Also, how can I make the insert option appear in the grid?
Question by:brettr
    1 Comment
    LVL 29

    Accepted Solution

    In order to allow edits/deletes your datasource must contain the primary key column for that table.
    This way the IDE can create the SQL statements required for updates/deletes

    otherwise we end up with....
    Update myTable setColumn1 = "HelloWorld" where ?????

    If the datasource contains the primary key (say myID) then the statement becomes
    Update myTable setColumn1 = "HelloWorld" where myID = <value>

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    732 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

    22 Experts available now in Live!

    Get 1:1 Help Now