Search code examples
c#ado.netstrongly-typed-dataset

TableAdapter of Strongly Typed dataset won't let me generate the Update method


I have a view from my database being represented as a TableAdapter, but I cannot get it to generate the Update methods. The, "Create methods to send updates directly to the database (GenerateDBDirectMethods)" is grayed out.

How can I enable this? Or will I have to do this manually?


Solution

  • Your table adapter is bound with a view so the schema of associated data-table is the schema of the view. Your view must be involving fields from more than one table so in this case the table-adapter is not able to generate a concrete update statement which can do insert/update operation against the view. So you are not able to generate a distinct Update method for the table-adapter which is associated with a view.