views:

280

answers:

1

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?

+1  A: 

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.

this. __curious_geek
So I will have to do it manually?
Malfist
You can write a stored procedure and bind it with table-adapter.Update() method call. You pass the parameters in the sp and then let sp do the update.
this. __curious_geek