How to update one table based on a match found in another

  • Thread starter Thread starter Martouff
  • Start date Start date
M

Martouff

Hi

I'm trying to figure out the best way to perform a simple but
repetitive task in vb.net.
Access DB with 2 tables: first table - a list of phone numbers not to
call and a table holding contact information.
Both tables have a 'telephone' column and I need to set a logical flag
= 1 in the second table only if a match is found in the first.

I've tried using a single Dataadapter for each and two Datasets and
every other combination.
I've even tried example code from MS (KB Q308057) but this doesn't
work.

However, when I try to retrieve a record it all falls apart and vb.net
throws a relation exception that I cannot fathom out.

I know I can run a simple update query - but want to do this
programatically.

If anyone can throw me a bone or suggest a place to start again - I
really would appreciate any help.

With thanks
 
It sounds like you will do an Insert Into in the first table based on a
condition in the second. The actual ADO.Net code should probably just be
your SQL statement executed as a non-query, no datatable or dataset
involved.
 
Back
Top