Compare non-PK in two datasets

  • Thread starter Thread starter Tommy Malone
  • Start date Start date
T

Tommy Malone

I'm attempting to import data from an external source into a database. My
question is how can I compare the value of a specified column that is not a
primary key before adding the row to my dataset (and then into the db)?

My process is this:

1. Read data into a dataset from external source (xml or excel)
2. Compare with existing dataset column ("Title")
3. If "Title" does not exist, add the new row from external data source
4. If "Title" does exist, go to next row in external data source

My difficulty is doing this comparison without the benefit of the FindBy
method since "Title" is not a PK.
 
Hi Tommy,

You might use DataView, sorted by title.
Its Find method will search by sorted field(s).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top