开发者

LinQ updating duplicate records into Detail table

开发者 https://www.devze.com 2022-12-15 04:42 出处:网络
I have two tables emp and empDetail. Using linQ I am inserting records from my VB.net Windows Service every night.

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

精彩评论

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

关注公众号