Cylindric
Member
- Joined
- Apr 4, 2007
- Messages
- 5
- Programming Experience
- 5-10
Hi there folks,
I have a bit of a problem that I'm not sure how best to tackle. I think I might be missing a trick somewhere.
I am working on an in-house tool that is going to synchronise one database (MSSQL) with another completely different database (MySQL), containing completely different schema.
What I would like some advice on is the best way of doing the processing. My problem is mainly (I think
) that I'm not very familiar with datasets and the other great data-handling structures in .net, so may well be missing something obvious.
This is what I'm doing at the moment:
Basically, I'm caching both sets of data, updating/adding records, then deleting anything that wasn't touched.
Apologies for a slightly rambling post, I'm not entirely sure how to articulate the problem, or how much actual code to paste.
Thanks in advance,
Mark
I have a bit of a problem that I'm not sure how best to tackle. I think I might be missing a trick somewhere.
I am working on an in-house tool that is going to synchronise one database (MSSQL) with another completely different database (MySQL), containing completely different schema.
What I would like some advice on is the best way of doing the processing. My problem is mainly (I think

This is what I'm doing at the moment:
VB.NET:
SELECT data from source (reference) table
For each record
Populate an object with the field-values
Add the object to a SOURCE collection
SELECT data from target table
For each record
Populate an object with the field-values
Add the object to a TARGET collection
(I now have two collections)
For each Object in SOURCE
If Exists In TARGET Then compare with TARGET and update target table if necessary
Else Add new record to target table
For each Object in TARGET
If not updated yet, then it's been removed from SOURCE so delete from target table
Apologies for a slightly rambling post, I'm not entirely sure how to articulate the problem, or how much actual code to paste.
Thanks in advance,
Mark
Last edited: