【发布时间】:2012-06-19 13:39:13
【问题描述】:
大家好,我正在使用 objectdatasource 创建更新功能。实际上它工作正常,直到我没有更改 UpdateMethod 的参数。我有两个参数,但它需要三个参数。给我以下错误。
ObjectDataSource 'ODSConfig' could not find a non-generic method 'UpdatePagedDataSet' that has parameters: CONFIG_VALUE, configKey, configValue.
C#代码:
protected void ODSConfig_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
TextBox val = (TextBox)GVConfig.Rows[GVConfig.EditIndex].Cells[2].Controls[0];
Parameter objKeyConfig = new Parameter("configKey", DbType.String, GVConfig.Rows[GVConfig.EditIndex].Cells[1].Text);
Parameter objKeyValueConfig = new Parameter("configValue", DbType.String, val.Text);
e.InputParameters["configKey"] = objKeyConfig.DefaultValue;
e.InputParameters["configValue"] = objKeyValueConfig.DefaultValue;
}
【问题讨论】:
-
您的错误消息说您的更新方法中需要三个参数。您缺少 CONFIG_VALUE 参数。
-
@BogdanRotund:我不想要第三个参数。即使在业务逻辑中,我也只有两个参数。
-
检查你的 UpdatePagedDataSet 有多少个参数。
标签: asp.net entity-framework objectdatasource