Created
February 27, 2018 05:58
-
-
Save talkingdotnet/38f0c1d46cdc2e4a6576e8c5e0a87b33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool Import(string url = "") | |
{ | |
WriteToConsole("** MySql Data Export Started**"); | |
bool bValue = true; | |
string newFileName = "Dbdata.xml.gz"; | |
string filePath = Path.Combine(_directoryPath, newFileName); | |
if(url != "") | |
bValue = DownloadFile(url, filePath); | |
if (bValue) | |
{ | |
string unZippedFileName = UnZipFile(filePath); | |
if (unZippedFileName == "") | |
{ | |
WriteToConsole("Some error occured while unzipping the file. DB export is stopped."); | |
return false; | |
} | |
DataSet ds = DeserializeDataset(unZippedFileName); | |
if (ds != null) | |
{ | |
TransferData(ds); | |
WriteToConsole("** MySql Data Export Finished**"); | |
} | |
else | |
bValue = false; | |
} | |
return bValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment