开发者

ASP.NET troubles with updating DataGrid binded to custom DataTable

开发者 https://www.devze.com 2022-12-23 19:40 出处:网络
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 Missi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消