开发者

LinQ updating duplicate records into Detail table

I have two tables emp and empDetail. Using linQ I am inserting records from my VB.net Windows Service every night.

Before inserting I am checking if the record already exists in emp table. If record doesn't exist I am inserting it else I am skipping it.

For some 开发者_如何学Creason the service ran twice last night and I noticed that, it inserted duplicate records into empdetail table. How can I fix the issue.


I'm assuming that if you determine the emp record already exists, you skip adding empDetail records as well. So, if this is the case, it sounds to me like the check you have to see if the emp record already exists is flawed.

Randy

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜