Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

I have an application that will upload the local database to the main database.
I use a web service to do that and my dilemma is that how will I pass the database to the web service.

I come up with a solution to pass it by a DataSet.GetXml() and use the sp_xml_preparedocument in mssql to mass insert it into the main database.

I'm just wondering if passing it as a DataSet would be a better idea.

The local database is in MySQL while the main database is in MSSQL.
And I use a winform application in local machine.

Please help me.

Thanks in Advance.
Posted
Updated 13-Jul-11 0:28am
v3
Comments
Ger Hayden 13-Jul-11 5:39am    
Watching this with interest. In time I am going to have to do something similar with my ticketing system, where individual services notify home office of tickets purchased and used when operating in stand alone mode while also receiving from home office details of all tickets purchased or used on other services for use in the next standalone session. But it will be MySql to MySql.

By default, sending the DataSet to the webservice is no different than sending the GetXml data. The DataSet will still get seriailized into XML and sent.
 
Share this answer
 
If the stored procedure will take a DataSet's serialised form and merge it directly, and it is not too slow, then that seems a good approach. Anything else will require writing some code. I think passing a DataSet across a web service will serialise it in a similar way anyway for the transfer.
 
Share this answer
 
The other solution is to export the database as SQL statements and run those through MsSql in the main DB: that way any column changes could also be reflected in the main DB.
 
Share this answer
 
Comments
unknowndentified10111 13-Jul-11 4:06am    
I think it is not possible since the local database is in MySQL while the main database is in mssql but thanks for the reply.
OriginalGriff 13-Jul-11 4:10am    
Then edit your question and say it! Don't leave out important information: it leads to wrong answers...:laugh:
Use the "Improve question" widget to edit your question and provide better information.
unknowndentified10111 13-Jul-11 4:12am    
Sorry. Its my first time to post a question.
OriginalGriff 13-Jul-11 4:15am    
No problem!
Just try to give all the relevant info - pretend we can't see your screen! :laugh:
BobJanova 13-Jul-11 5:57am    
I think you can ask either database to export in standards-compliant mode. But I'm not sure how you'd get compliant SQL from a DataSet.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900