Ошибка:
Невозможно обновить EntitySet 'ClientFeedBack', так как он имеет DefiningQuery и в элементе <ModificationFunctionMapping>
отсутствует элемент <InsertFunction>
для поддержки текущей операции.
Код:
protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
ProTrakEntities1 objEntity = new ProTrakEntities1();
TextBox txtTitle = DetailsView1.FindControl("txtTask") as TextBox;
RadComboBox cmbStatus = DetailsView1.FindControl("cmbStatus") as RadComboBox;
RadComboBox cmbTaskType = DetailsView1.FindControl("cmbTasktype") as RadComboBox;
RadComboBox cmbTaskPriorty = DetailsView1.FindControl("cmbPriority") as RadComboBox;
string Description = (DetailsView1.FindControl("RadEditor1") as RadEditor).Content;
ClientFeedBack objResource = new ClientFeedBack();
objResource.Title = txtTitle.Text;
objResource.Description = Description;
objResource.TaskPriorityID = Convert.ToInt32(cmbTaskPriorty.SelectedValue);
objResource.TaskTypeID = Convert.ToInt32(cmbTaskType.SelectedValue);
objEntity.AddToClientFeedBacks(objResource);
objEntity.SaveChanges();
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true);
}
Моя таблица называется ClientFeedBack
.