I wrote the following code, according to this post: CRUD Operations using stored procedure in Entity Framework
using (var context = new SamenEntities())
{
try
{
register pazhoheshgar = new register()
{
id = textBox1.Text.Trim(),
name = textBox2.Text.Trim(),
family = textBox3.Text.Trim(),
birth_date = dateTimePicker1.Value,
mobile = textBox8.Text.Trim(),
email = textBox11.Text.Trim()
};
pazhoheshgar.id= textBox1.Text.Trim();
context.SaveChanges();
MessageBox.Show("OK!!!", "Done");
}
catch
{
MessageBox.Show("ERROR!!!", "error");
}
}
I already used insert and delete stored procedure, without problem, but now the "DONE!!!" message is displayed, but the change does not occur in the database.