1
大家好我正在用objectdatasource創建更新功能。實際上它工作正常,直到我沒有更改UpdateMethod的參數。我有兩個參數,但它期待三個參數。給我下面的錯誤。Objectdatasource更新問題
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:我不想要第三個參數。即使在業務邏輯中,我只有兩個參數。 – user968441
檢查您的UpdatePagedDataSet具有多少個參數。 –