compare from xml

QuertonQuerton Posts: 11
edited August 26, 2005 11:54AM in SQL Toolkit Previous Versions
Good morning,

I'm facing an easy (I hope it's easy) little issue. I need to compare the data that are in a XML file to a database. How can I do that ? :)

In other words, how can I connect the toolkit to a XML file (includes schema & data) that has been generated from a dataset.writexml method ?

Is there a way to cast a dataTable to a RedGate Table ?

I'm currently thinking to re create a new db from my xml file then start the comparision between this db and the target one.... but it's a bit tricky no ? I hope that there are others solutions

Thanks in advance


Regards

Pierre

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello Pierre,

    I'm sure that this is possible, but I do not know exactly how. Since SQLDataCompare.Engine.Table derives from System.Data.SqlClient.Table, it should be possible to construct a New SQLDataCompare.Engine.Table and feed the data into it from your DataSet.Table.

    There is another fellow in the forum who had done something similar with a SQLCompare.Engine.Table: maybe his example code can help?

    http://www.red-gate.com/MessageBoard/vi ... php?t=1082
  • Hi Biran,

    I have to admit that I don't enough knowledges in C# & comparison tool. Because I've not completly understood the example that you gave me.

    But I've tryed to use it to be able to create from scratch a SQLDataCompare.Table object regarding my table in my dataset. And it works ! Thanks

    But now I've several issues:

    1) How to populate with the data in that new table with what I have in my dataset ?

    2) How to insert my new table in a SQLDataCompare.Tables collection, beause I don't see any Add() Method...


    Thanks a lot for your last quick responds

    pierre
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I'll have a look at this tomorrow. I'm still not entirely sure that this can be done as SQLDataCompare.Table doesn't normally actually contain data, just schema.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Sorry, I do not think that this can be done. SQL Data Compare needs to read the data from an actual table. I don't see a way of creating and populating a table and adding it to a database object this way.
  • Hi Brian,

    Thanks for your support and quick answers.

    That's too bad.. I've request my company to buy the toolkit on purpose for this.. next time I'll read more carefully the possibilities of 3rd party tools (my fault...)

    Nevermind, I think I can still use the powerfull of the toolkit by recreating a temporary db and fill the data from the xml file. Then compare the 2 db.
    It will be a bit tricky but it'ok ....

    I think it could be a good think to be able to compare a db vs dataset or 2 dataset with the toolkit. isn't it ?

    Thanks again

    pierre
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    We are looking into the possibility of adding snapshots to Data Compare the same as SQL Compare. Pending a feasability study and some test cases, they might appear in Data Compare 4. (Of course no promises from me, though!!)
  • Hi Brian,

    That's sounds to be a really nice thing :)

    When it's plan to be released ?

    Regards
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    End of the year (2005) hopefully.
This discussion has been closed.