سلام دوستان : من قصددادم چندتاداده رودرون جدولم درج کنم اما موقعی که داده هامو توی تکس باکس واردمیکنم وکلیددرج روکلیک میکنم خطای
Unable to update the EntitySet 'Telephons' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation. ---> System.Data.UpdateException: Unable to update the EntitySet 'Telephons' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation. میده مشکلم چیه .اینم بگم وقتی اول جدولمو داخل دیتاگریدنمایش میدم درسته اما موقع عمل درج به این مشکل میخورم.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using EntityFrameWork;
namespace EntityFrameWork
{
public partial class Form1 : Form
{
ApressEntities database = new ApressEntities();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Telephon table = new Telephon
{
Name = textBox1.Text,
Family = textBox2.Text,
Tel = textBox3.Text,
Address = textBox4.Text,
};
database.Telephons.Add(table);
database.SaveChanges();
dataGridView1.DataSource = database.Telephons.ToList();
}
}
}