Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi...

Please anyone tell me can i use mysqldump query in wcf service...If i use it will work or not? how can i take backup of existing database by using wcf...Please provide some wcf samples to know about dump....

Please reply!!!

Thanks in advance:)
Posted
Updated 25-Aug-11 23:47pm
v2
Comments
[no name] 26-Aug-11 5:50am    
WCF is intended to serve as a communication medium between two apps. Why do you want to backup your database using WCF?
Wayne Gaylard 26-Aug-11 6:45am    
If the service is located on a server far from the user, then WCF is the best way to do it.
kal35 7-Oct-11 9:20am    
we are developing one windows application. In that we are getting real time data in every seconds and store it in database. if the database contains huge amounts of data we have to take backup and remove the old data from the database.....

for that I have to develop wcf service.....I have to take backup of the remote system database from local system and store it in some other location of the remote system....Please tell me how to dump database in wcf service

1 solution

You can create 2 procedures in your service, one for backing up, and the other for restoring. To back up you need to make use of the MySQL SELECT .... INTO OUTFILE query syntax (just remember that you have no control of where the mysql server dumps this file, and that you can only backup one table at a time). Then to restore you need to use the LOAD DATA INFILE query syntax. I leave it up to you to google the correct way to use these queries. Personally, I created two classes that backup and restore MySQL databases completely. I have written an article about it on CP, MYSQL Backup Utility[^]. I then use these classes to backup and restore from my WCF service. If you need any help trying to get it to work over your service, just reply on the forum below the article, and I will try and help as much as I can.

Hope this helps
 
Share this answer
 

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