O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Questions That Should Be Asked More Frequently

Q

When I try to submit changes using a TableAdapter’s Update method, I get an exception stating that "Update requires a valid UpdateCommand when passing a DataRow collection with modified rows." What went wrong?

A

This is the same exception you would receive if you called the Update method on a SqlDataAdapter without having supplied updating logic. The TableAdapter Configuration Wizard does not display any warnings or errors if it fails to generate the logic required to submit changes to the database. There are three common scenarios where the TableAdapter lacks updating logic:

  • You neglected to include the primary key column or columns in the TableAdapter’s query.

  • The table you used in the TableAdapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required