synchronizing xml and database
-
Hallo I'm consuming a webservice returning an XML with 5 nested complexType (i.e. 5 relationed tables); I should write those data into corresponding tables in a mssql db, updating or inserting when needed. Do DataAdapters provide such functionality? Actually, the Update method synchronizes a dataset and its original data source. What if the dataset comes from a different datasource? Update uses the RowState property to determine the kind of SQL command to be issued: in my case I should need something like an hash comparison (checksum) between each row in the source dataset and each row in the target db, for each table. I'm considering to transfer to the db the whole process of hashing and comparing. Could you give me your advice? Thanks in advance
-
Hallo I'm consuming a webservice returning an XML with 5 nested complexType (i.e. 5 relationed tables); I should write those data into corresponding tables in a mssql db, updating or inserting when needed. Do DataAdapters provide such functionality? Actually, the Update method synchronizes a dataset and its original data source. What if the dataset comes from a different datasource? Update uses the RowState property to determine the kind of SQL command to be issued: in my case I should need something like an hash comparison (checksum) between each row in the source dataset and each row in the target db, for each table. I'm considering to transfer to the db the whole process of hashing and comparing. Could you give me your advice? Thanks in advance
I'm going for the Dataset.Merge(DataSet) method, as in http://msdn.microsoft.com/it-it/library/4swwh51k(v=vs.80).aspx[^] But I would still like to know your opinion, since I hate dealing with recordsets within a code: databases are born to deal with recordsets, and I'm a db guy :)
-
Hallo I'm consuming a webservice returning an XML with 5 nested complexType (i.e. 5 relationed tables); I should write those data into corresponding tables in a mssql db, updating or inserting when needed. Do DataAdapters provide such functionality? Actually, the Update method synchronizes a dataset and its original data source. What if the dataset comes from a different datasource? Update uses the RowState property to determine the kind of SQL command to be issued: in my case I should need something like an hash comparison (checksum) between each row in the source dataset and each row in the target db, for each table. I'm considering to transfer to the db the whole process of hashing and comparing. Could you give me your advice? Thanks in advance
Your question isn't clear. For starters the XML and web services part would seem to have little to do with it. If you have a set of data, regardless of source, which must put into the database as one go then the normal solution is a transaction. If there are multiple target data sources then a distributed transaction MIGHT be a choice however at least some people prefer to use a non-transactional approach in that case.
-
Your question isn't clear. For starters the XML and web services part would seem to have little to do with it. If you have a set of data, regardless of source, which must put into the database as one go then the normal solution is a transaction. If there are multiple target data sources then a distributed transaction MIGHT be a choice however at least some people prefer to use a non-transactional approach in that case.
Schematically, I'm dealing with two datasets with the same schema: they have 5 tables. I need to synchronize the two dataset, being Dataset A the source (XML from webservice) and Dataset B the destination (the database).
-
Schematically, I'm dealing with two datasets with the same schema: they have 5 tables. I need to synchronize the two dataset, being Dataset A the source (XML from webservice) and Dataset B the destination (the database).
LordZoster wrote:
I need to synchronize the two dataset, being Dataset A the source (XML from webservice) and Dataset B the destination (the database)
Yes I understand that you are starting with XML. However that has nothing to do with writing the data in a consistent manner to he database. If you need to read the XML data in a consistent manner than that is still a different problem UNLESS you need to provide some transaction across both sets. If so then, because the first appears to be a file, you are still going to be dealing with a transaction on the database side and for the file side there are mitigations possible but none are ideal.