tags:

views:

33

answers:

1

Hello Experts, 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 reason the service ran twice last night and I noticed that, it inserted duplicate records into empdetail table. How can I fix the issue.

A: 

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

Randy Minder