MebsisEntities db = new MebsisEntities();
private void button1_Click(object sender, EventArgs e)
{
db.SaveChanges();
CalisanTelefon calisan = new CalisanTelefon();
//calisan.CalisanID = "11111101866";
//calisan.Telefon = "0 532 111 11 11";
foreach (var item in db.Calisan)
{
Random rnd=new Random();
int random = rnd.Next(1000, 10000);
calisan = new CalisanTelefon();
calisan.Telefon = "0 535 422 ";
calisan.CalisanID = item.TCKimlikNo;
calisan.Aciklama = "generated";
db.AddToCalisanTelefon(calisan);
db.SaveChanges();
// MessageBox.Show("ok"+item.Adi);
}
what is wrong with this. It gives error at db.savechanges but I dont think that is related to database :(