Can you please let me know why I am not able to add data to Region table here?
protected void Button4_Click(object sender, EventArgs e)
{
Region newRegion = new Region()
{
RegionID = 5000,
RegionDescription = TextBox1.Text
};
db.Regions.Add(newRegion);
db.SaveChanges();
}
I am getting this error:
at:
db.Regions.Add(newRegion);
I have a Region class as:
namespace EFDataStore
{
using System;
using System.Collections.Generic;
public partial class Region
{
public int RegionID { get; set; }
public string RegionDescription { get; set; }
}
}
