ASP.NET troubles with updating DataGrid binded to custom DataTable
I bind custom DataTable to DataGrid through ObjectDataSource, where i use SelectMethod and UpdateMethod. SelectMethod working great, but when I开发者_运维问答 try to update row it's breaking by MissingMethodException. What should i do to fix this problem?
Sorry for my bad english ;)
Make sure that your update method has the right parameters. For example if in your grid you have the following fields:
<asp:BoundField DataField="Id" HeaderText="ID:" />
<asp:BoundField DataField="Name" HeaderText="Name :" />
your update method could look like this:
public void Update(int Id, string Name)
{
//...
}
Here's a full example.
精彩评论