Compare specific field from two different database table
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts
Page 1 of 1
I'm actually developing a synchronization tool in vb.net, I have two database that have on each table records field GUID, this field help to have the same PK on both database. On each record there is also a field called lastUpdated, this field have a milliseconds value, so prevent two user to update the record in the same time. My question is, how I can compare the records of the same table from different db? For example:
ONLINE_DATABASE
TABLE_1
TABLE_1
NOTICE THAT: the table have the same name in both db
ONLINE_DATABASE
TABLE_1
Code: Select all
CLIENT_DATABASE| ID | GUID | NAME | LASTUPDATED |
| 5 | 054ba092-b476-47ed-810b-32868cc95fb| John | 06-01-2016 17:01:12.472438 |
TABLE_1
Code: Select all
How you can see I've update the record from client application, so I need to apply the same change to online database. Now I've a thousand records to check in about ten tables. So my question is, how I can made a system that do this? Actually I tough to read each row with a MySqlCommand reader but I also think that this procedure is slow... Suggest?| ID | GUID | NAME | LASTUPDATED |
| 9 | 054ba092-b476-47ed-810b-32868cc95fb| Jack | 06-01-2016 18:01:12.472438 |
NOTICE THAT: the table have the same name in both db
I'm in the empire business.
I'd suggest you use relational mappings for your tables. Then, you can setup by-pass connecters for the different databases you have, and voila! If you need help, you know where to find me! 

relational mapping? I don't know what is this, could you help me?
I'm in the empire business.
Again, I doesn't have skype account more, you have another social like hangouts or other?
I'm in the empire business.
visualtech wrote:labs.visual@gmail.com - HangoutsI contacted you, hope that you can help.. I'm Ferven
I'm in the empire business.
For what you've mentioned a simple query like the following should do; tweak it as you like:
Code: Select all
SELECT
CLIENT_DATABASE.TABLE_1.*,
ONLINE_DATABASE.TABLE_1.*
FROM
CLIENT_DATABASE.TABLE_1
INNER JOIN ONLINE_DATABASE.TABLE_1
ON CLIENT_DATABASE.TABLE_1.GUID = ONLINE_DATABASE.TABLE_1.GUID
8 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023