Hi guys,
I am relatively new to VB 2005 programming and am trying to develop an application that copies tables from Source A to Source B.
i am able to copy tables fine, however i would like to check data while copying.
basically i would like to the following.
IF SourceDataSet.Row in DestDataSet THEN
Update record in DestDataSet = SourceDataSet.Value
Else
INSERT new record to DestDataSet
i am able to create the various datasets i need, i just cant seem to figure out how to reference a partiular value in DataSetA and compare it to DataSetB
i am thinking the SQL to populate both the DataSets would be like (col1 is an ID)
SELECT Col1, Col2 FROM Table1
get the particular value from row x, col1 using a loop and assign it to a string
str1 = dataset(x,col1).value
then to see if the record in the Source is in the Dest would be like
SELECT Col1 FROM Table1 Where Col1 = str1
then test to see of anythign was returned (as it woudl be 1 value or nothing) then i woudl decide to do the update or insert statement.
i bascially just need to know how to read the datasets to get the values to assign for testing.
if there is an easier approach to this i would be more than happy to hear suggestions.
any help would be much appreciated, thank you