Skip to content

Instantly share code, notes, and snippets.

@talkingdotnet
Created February 27, 2018 05:58
Show Gist options
  • Save talkingdotnet/38f0c1d46cdc2e4a6576e8c5e0a87b33 to your computer and use it in GitHub Desktop.
Save talkingdotnet/38f0c1d46cdc2e4a6576e8c5e0a87b33 to your computer and use it in GitHub Desktop.
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