本文介绍了Linq to Entities问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


我的数据库中有一个商家表。它有一个BusinessID作为其PK与SQl自动增量。


一切正常,但我对某事感到困惑。



Business NewBusiness = new Business() ;
NewBusiness.Name = BusinessNameTxt.Text;

BusinessActions Ba = new BusinessActions();


NewBusiness.BusinessID //它会给我一个自动编号。它在我插入记录之前知道这一点,这是如何工作的?。


如果i 5个网页同时插入一条记录,那将是多么美好。 linq会不会得到重复的数字?


这是一个有趣的问题。




谢谢


gary

解决方案

 hi

I have a Business Table in my DB. it has a BusinessID as its PK with SQl auto Increment. 

All works fine however i am confused about something.

 

 Business NewBusiness = new Business();
        NewBusiness.Name = BusinessNameTxt.Text;
   


        BusinessActions Ba = new BusinessActions();

NewBusiness.BusinessID  // it will give me the auto number. It knows this before i insert the record, how does this work ?.

what happnes if i 5 webpages eatch inserting a record at the same time. will linq to entites not get duplicate numbers ?

this is a interesting question.

 

 

thanks

gary

解决方案


这篇关于Linq to Entities问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 13:47