17 Temmuz 2012 Salı

.NET EntityFramework Hatası

EntityFramework ile çalışırken çok gıcık bir hata aldım hata şöyle;
 “An error occurred while starting a transaction on the provider connection. See the inner exception for details”

Bu Hataya sebep olan şey;
foreach (Object item in qry)
{
  item.FirstName = ....
  ... etc, digercodlar.....
  DBEntities.SaveChanges();
}
  
foreach içerisinde  SaveChanges() komutunu kullanmam 
yapam gereken ise sadece SaveChanges() 
komutunu foreach içerisinden çıkartmak.
 
 foreach (Object item in qry)

{
  item.FirstName = .... 

  ... etc, diger kodlar....
} 
  DBEntities.SaveChanges();

1 yorum:

  1. What's up, of course this piece of writing is in fact pleasant and I have learned lot of things from it about blogging. thanks.

    My site ... plano seo company

    YanıtlaSil